Closed Thread Icon

Topic awaiting preservation: OT: FormatDateTime Function Pages that link to <a href="https://ozoneasylum.com/backlink?for=22128" title="Pages that link to Topic awaiting preservation: OT: FormatDateTime Function" rel="nofollow" >Topic awaiting preservation: OT: FormatDateTime Function\

 
Author Thread
Tester123
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Jun 2004

posted posted 06-10-2004 05:16

Hi :)

I have some problems on the FormatDateTime Function.
Can anyone give me some help on this?

I use: <%=FormatDateTime(rs1("DateField"), vbShortDate)%>
and it displays like: 6/8/2004. However, my server's regional setting is:
MM-dd-yy, it should be 06-08-04. Anyone can tell me why is that? :(

Thanks

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 06-10-2004 11:08

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

posted posted 06-10-2004 15:07

Yes so what you want is
Format(yourVariable, "MM-dd-yy")

... personally, i think all of these date formats are utter crap.

Everyone, and i mean everyone should use dd-mmm-yyyy format. Its silly not to, if you have the option then do this... Why? Because this gives you 02-Jan-2004 for example which is impossible to confuse.. if i see 08-06-2004, how am i supposed to know if its 8th June or 6th August?

I think the time format has been really badly implemented basically everywhere, why should microsoft bother having any option in regional settings, when they can use a format that works for everyone...

Sickens me

Tester123
Obsessive-Compulsive (I) Inmate

From:
Insane since: Jun 2004

posted posted 06-10-2004 19:58

Hi,

Thanks guys! :) But I still have some problems on it..

If I use <%=Format(var, "ddd, mmm d, yyyy")%>
I will receive:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'Format'

If I use <%=Format$(var, "ddd, mmm d, yyyy")%>
I will receive:
Invalid character
Response.Write(Format$(
-------------------------^

Any ideas? :(

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-10-2004 20:29
quote:
Everyone, and i mean everyone should use dd-mmm-yyyy format.



Not to be a complete yankee but the US doesn't use this format. We do MM-DD-YYYY.

just cuz we can

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-10-2004 20:37

well, the only 'right' date format is yyyy-mm-dd hh:mm:ss anyhow. ISO all the way, baby, and at least it's got a strict ordering from biggest to smallest amounts of time.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-11-2004 02:06

Bah I'm just getting a Unix time calender

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

posted posted 06-11-2004 06:39

yyyy-mm-dd is not the right format either.. you simply must have mmm otherwise the date and month can be confused.

And yes i know US uses mm-dd-yyyy they are backwards as usual :P and cant even do metric heh..

my point is even if they do mm-dd-yyyy they should be doing mmm-dd-yyyy.

mmm is the ONLY format that distinguishes date from month. Anything else is lazy practice imo...

Oh tester if the code is in VB you have to put hashes in somewhere for date formatting, so it knows its a date. "# " & mydate & " #"

etc..

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 06-12-2004 08:14

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 06-12-2004 08:31

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

« BackwardsOnwards »

Show Forum Drop Down Menu