Skip to main content
Participant
May 28, 2008
Answered

Reversed dates

  • May 28, 2008
  • 5 replies
  • 532 views
We have just moved to a new server, upgrading from CF6 to CF7 (package using CF not tested with CF8).

I am now getting weird rersults with CFDIRECTORY, where the lastmodified returned value is reversed. Therefore if the date should be 27 May 2008, I am getting 08 May 2027 returned. If I add a day to the date before displaying it, instead of 28 May 2008, I get 09 May 2027displayed.

Is this a CF issue/setting or a Windows setting?

Thanks

Andy
This topic has been closed for replies.
Correct answer NFDC_Andy
Thanks for the things to try.

Dan, when I cfdump I get "27/05/08 10:05" (on the old server I get "27 May 2008 10:05:32 o'clock GMT").

PaulH, getLocale returns "English (UK)" (as I would probably expect).

I have had another look at available CF functions, and have found that if I convert the lastmodifieddate using lsdateformat, the result is OK ie. I get what I want. This appears to work on both old and new servers, so I have a workaround solution (but would still like to know why it has always worked before).

5 replies

Inspiring
May 30, 2008
NFDC Andy wrote:
> PaulH, getLocale returns "English (UK)" (as I would probably expect).
>
> I have had another look at available CF functions, and have found that if I
> convert the lastmodifieddate using lsdateformat, the result is OK ie. I get

probably means the OS or cf locale is different between the servers.
NFDC_AndyAuthorCorrect answer
Participant
May 30, 2008
Thanks for the things to try.

Dan, when I cfdump I get "27/05/08 10:05" (on the old server I get "27 May 2008 10:05:32 o'clock GMT").

PaulH, getLocale returns "English (UK)" (as I would probably expect).

I have had another look at available CF functions, and have found that if I convert the lastmodifieddate using lsdateformat, the result is OK ie. I get what I want. This appears to work on both old and new servers, so I have a workaround solution (but would still like to know why it has always worked before).
BKBK
Community Expert
Community Expert
May 29, 2008
Did you correct Coldfusion for the U.S. Daylight Saving Time changes in 2007?


Inspiring
May 29, 2008
Do you get 27/05/08 with cfdump, or something like {ts '2008-05-27 00:00:00'}? What do you get when you cfdump now()?
Inspiring
May 28, 2008
To check, look at the files in Explorer. If they are correct, start looking at Cold Fusion. Remember, cfdump is your freind.
NFDC_AndyAuthor
Participant
May 29, 2008
In the Explorer it appears OK (properties of file says 27 May 2008), and when I dump (or display the value) I get 27/05/08, but when i use something like dateformat (eg. dateformat(datelastmodified,"dd mmm yyyy"), it takes it as 8 May 2027.

I can use the same CF page on the old server, and get 27 May 2008.

Any other ideas?

Thanks

Andy