Highlighted

cf date functions

Community Beginner ,
Jun 08, 2019

Copy link to clipboard

Copied

This is not an advanced issue ... but I cannot find in this forums software where to ask general questions about CF.

Navigation could be far better!

Ok ... I have an integer ... 43629 ... the day of a given date since 1/1/1900.

How do I do the reverse?

I need to make a date from that integer?

Anyone?

Adobe Community Professional
Correct answer by Charlie Arehart | Adobe Community Professional

dateadd('d',43629,'01-01-1900')

And:

https://forums.adobe.com/community/coldfusion

TOPICS
Advanced techniques

Views

369

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

cf date functions

Community Beginner ,
Jun 08, 2019

Copy link to clipboard

Copied

This is not an advanced issue ... but I cannot find in this forums software where to ask general questions about CF.

Navigation could be far better!

Ok ... I have an integer ... 43629 ... the day of a given date since 1/1/1900.

How do I do the reverse?

I need to make a date from that integer?

Anyone?

Adobe Community Professional
Correct answer by Charlie Arehart | Adobe Community Professional

dateadd('d',43629,'01-01-1900')

And:

https://forums.adobe.com/community/coldfusion

TOPICS
Advanced techniques

Views

370

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 08, 2019 0
Adobe Community Professional ,
Jun 08, 2019

Copy link to clipboard

Copied

dateadd('d',43629,'01-01-1900')

And:

https://forums.adobe.com/community/coldfusion

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 08, 2019 0
Community Beginner ,
Jun 08, 2019

Copy link to clipboard

Copied

As soon as I posted that, I had one of those DOH moments.

Was about to delete it when I saw your reply.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 08, 2019 0
Community Beginner ,
Jun 09, 2019

Copy link to clipboard

Copied

However, is there not a "bug" in CF where the integer we get from datdiff  from 1/1/1900 is actually like 1-2 days off?

As CF returns the value of something like December 31 1989?

Cause I've also noticed when I try to highlight "today" in my calendar it is off by a day one day, the 2 days off on others?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 09, 2019 0
Adobe Community Professional ,
Jun 09, 2019

Copy link to clipboard

Copied

You can file supposed bugs at tracker.adobe.com. Offer clear examples to demonstrate to them.

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 09, 2019 0
Community Beginner ,
Jun 09, 2019

Copy link to clipboard

Copied

I must have not phrased my question properly.

I thought I read somewhere that there is a DOCUMENTED bug using the "1/1/1900 feature" and I read about it within the past year but now Googling it I can't find it anywhere.

Ring a bell?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 09, 2019 0
Adobe Community Professional ,
Jun 09, 2019

Copy link to clipboard

Copied

No, but it is having to infer the date. In some locals, 2/4 would be in Feb, while others would be March. Best to use more explicit date values, or functions that create a date, to be explicit. 

null

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 09, 2019 0