FormatDateTime 
Author Message
 FormatDateTime

I am using windows 2000

I have set the date format in reginal setting in control panel to m/d/yy
short date sample over there is displayed correct 6/12/03

when I use this statement

FormatDateTime(currentdate,2)

it returns me 6/12/2003

it should return me 6/12/03

Pls help

thanks



Tue, 29 Nov 2005 04:44:59 GMT  
 FormatDateTime
I dont' know why it doesn't work either,  You can always cheat and do this
(but I am sure this is not what you are looking for):

oYear4= DatePart ("yyyy", Now)
oYear= oYear4-2000
oMonth= DatePart("m", Now)
oday= DatePart("d", Now)
oNewDateFormat= (omonth & "/" & oday & "/0" & oyear)
msgbox (oNewDateFormat)

--

need to e-mail me off list just get rid of "your fears" and
drop me a line.


Quote:
> I am using windows 2000

> I have set the date format in reginal setting in control panel to m/d/yy
> short date sample over there is displayed correct 6/12/03

> when I use this statement

> FormatDateTime(currentdate,2)

> it returns me 6/12/2003

> it should return me 6/12/03

> Pls help

> thanks



Tue, 29 Nov 2005 06:34:06 GMT  
 FormatDateTime
btw I researched this some (out of my curiousity) and found that

long date= Friday, June 13, 2003
short date= 6/13/2003

short date doesn't change from 2003 to 03

It seems that mm/dd/yyyy or dd/mm/yyyy and such are defined by your version
of windows you have and it appears the American English version of Windows
comes default of mm/dd/yyyy.  I guess that dont give you the option of
mm/dd/yy due to y2k and those concerns.

--

need to e-mail me off list just get rid of "your fears" and
drop me a line.


Quote:
> I am using windows 2000

> I have set the date format in reginal setting in control panel to m/d/yy
> short date sample over there is displayed correct 6/12/03

> when I use this statement

> FormatDateTime(currentdate,2)

> it returns me 6/12/2003

> it should return me 6/12/03

> Pls help

> thanks



Tue, 29 Nov 2005 20:29:14 GMT  
 FormatDateTime
If I can not use m/d/yy or mm/dd/yy then why those options are there?
Microsoft should remove this.

The problem is I have NT machine which is useing mm/dd/yy and the programs
are written for that and we are migrating to Windows 2000 or XP and those
programs fails.....

Can somebody confirm that yy is not supported anymore on American version of
W2K or XP?
thanks

I need to take care of this as an architecture of the system
-developer

Quote:

> btw I researched this some (out of my curiousity) and found that

> long date= Friday, June 13, 2003
> short date= 6/13/2003

> short date doesn't change from 2003 to 03

> It seems that mm/dd/yyyy or dd/mm/yyyy and such are defined by your
> version of windows you have and it appears the American English
> version of Windows comes default of mm/dd/yyyy.  I guess that dont
> give you the option of mm/dd/yy due to y2k and those concerns.



>> I am using windows 2000

>> I have set the date format in reginal setting in control panel to
>> m/d/yy short date sample over there is displayed correct 6/12/03

>> when I use this statement

>> FormatDateTime(currentdate,2)

>> it returns me 6/12/2003

>> it should return me 6/12/03

>> Pls help

>> thanks



Wed, 30 Nov 2005 01:12:04 GMT  
 FormatDateTime
Actually I played more.  If in the control panel, I change the regional
settings to d/m/yy, my script will run that way.

in the script:

DateNow= FormatDateTime(Now,2)
msgbox (DateNow)

my output is 6/13/03

So it does work for me

--

need to e-mail me off list just get rid of "your fears" and
drop me a line.


Quote:
> If I can not use m/d/yy or mm/dd/yy then why those options are there?
> Microsoft should remove this.

> The problem is I have NT machine which is useing mm/dd/yy and the programs
> are written for that and we are migrating to Windows 2000 or XP and those
> programs fails.....

> Can somebody confirm that yy is not supported anymore on American version
of
> W2K or XP?
> thanks

> I need to take care of this as an architecture of the system
> -developer


> > btw I researched this some (out of my curiousity) and found that

> > long date= Friday, June 13, 2003
> > short date= 6/13/2003

> > short date doesn't change from 2003 to 03

> > It seems that mm/dd/yyyy or dd/mm/yyyy and such are defined by your
> > version of windows you have and it appears the American English
> > version of Windows comes default of mm/dd/yyyy.  I guess that dont
> > give you the option of mm/dd/yy due to y2k and those concerns.



> >> I am using windows 2000

> >> I have set the date format in reginal setting in control panel to
> >> m/d/yy short date sample over there is displayed correct 6/12/03

> >> when I use this statement

> >> FormatDateTime(currentdate,2)

> >> it returns me 6/12/2003

> >> it should return me 6/12/03

> >> Pls help

> >> thanks



Wed, 30 Nov 2005 02:46:50 GMT  
 FormatDateTime
I also get the same correct output when run from Visual Basic

But when I include this in ASP page and run like this

<% RESPONSE.WRITE FormatDateTime(Now, 2) %>

I get 6/13/2003 as output...why asp page is not showing me 6/13/03

any clues?

-developer

Quote:

> Actually I played more.  If in the control panel, I change the
> regional settings to d/m/yy, my script will run that way.

> in the script:

> DateNow= FormatDateTime(Now,2)
> msgbox (DateNow)

> my output is 6/13/03

> So it does work for me



>> If I can not use m/d/yy or mm/dd/yy then why those options are there?
>> Microsoft should remove this.

>> The problem is I have NT machine which is useing mm/dd/yy and the
>> programs are written for that and we are migrating to Windows 2000
>> or XP and those programs fails.....

>> Can somebody confirm that yy is not supported anymore on American
>> version of W2K or XP?
>> thanks

>> I need to take care of this as an architecture of the system
>> -developer


>>> btw I researched this some (out of my curiousity) and found that

>>> long date= Friday, June 13, 2003
>>> short date= 6/13/2003

>>> short date doesn't change from 2003 to 03

>>> It seems that mm/dd/yyyy or dd/mm/yyyy and such are defined by your
>>> version of windows you have and it appears the American English
>>> version of Windows comes default of mm/dd/yyyy.  I guess that dont
>>> give you the option of mm/dd/yy due to y2k and those concerns.



>>>> I am using windows 2000

>>>> I have set the date format in reginal setting in control panel to
>>>> m/d/yy short date sample over there is displayed correct 6/12/03

>>>> when I use this statement

>>>> FormatDateTime(currentdate,2)

>>>> it returns me 6/12/2003

>>>> it should return me 6/12/03

>>>> Pls help

>>>> thanks



Wed, 30 Nov 2005 03:47:06 GMT  
 FormatDateTime
yeah you need to change the regional setting on the server.  ASP is run
server side so it will use the setting on the server and not the client
machine.

--

need to e-mail me off list just get rid of "your fears" and
drop me a line.


Quote:
> I also get the same correct output when run from Visual Basic

> But when I include this in ASP page and run like this

> <% RESPONSE.WRITE FormatDateTime(Now, 2) %>

> I get 6/13/2003 as output...why asp page is not showing me 6/13/03

> any clues?

> -developer


> > Actually I played more.  If in the control panel, I change the
> > regional settings to d/m/yy, my script will run that way.

> > in the script:

> > DateNow= FormatDateTime(Now,2)
> > msgbox (DateNow)

> > my output is 6/13/03

> > So it does work for me



> >> If I can not use m/d/yy or mm/dd/yy then why those options are there?
> >> Microsoft should remove this.

> >> The problem is I have NT machine which is useing mm/dd/yy and the
> >> programs are written for that and we are migrating to Windows 2000
> >> or XP and those programs fails.....

> >> Can somebody confirm that yy is not supported anymore on American
> >> version of W2K or XP?
> >> thanks

> >> I need to take care of this as an architecture of the system
> >> -developer


> >>> btw I researched this some (out of my curiousity) and found that

> >>> long date= Friday, June 13, 2003
> >>> short date= 6/13/2003

> >>> short date doesn't change from 2003 to 03

> >>> It seems that mm/dd/yyyy or dd/mm/yyyy and such are defined by your
> >>> version of windows you have and it appears the American English
> >>> version of Windows comes default of mm/dd/yyyy.  I guess that dont
> >>> give you the option of mm/dd/yy due to y2k and those concerns.



> >>>> I am using windows 2000

> >>>> I have set the date format in reginal setting in control panel to
> >>>> m/d/yy short date sample over there is displayed correct 6/12/03

> >>>> when I use this statement

> >>>> FormatDateTime(currentdate,2)

> >>>> it returns me 6/12/2003

> >>>> it should return me 6/12/03

> >>>> Pls help

> >>>> thanks



Wed, 30 Nov 2005 03:49:16 GMT  
 FormatDateTime
Yes I did change that on server...I am working on server itself....
Quote:

> yeah you need to change the regional setting on the server.  ASP is
> run server side so it will use the setting on the server and not the
> client machine.



>> I also get the same correct output when run from Visual Basic

>> But when I include this in ASP page and run like this

>> <% RESPONSE.WRITE FormatDateTime(Now, 2) %>

>> I get 6/13/2003 as output...why asp page is not showing me 6/13/03

>> any clues?

>> -developer


>>> Actually I played more.  If in the control panel, I change the
>>> regional settings to d/m/yy, my script will run that way.

>>> in the script:

>>> DateNow= FormatDateTime(Now,2)
>>> msgbox (DateNow)

>>> my output is 6/13/03

>>> So it does work for me



>>>> If I can not use m/d/yy or mm/dd/yy then why those options are
>>>> there? Microsoft should remove this.

>>>> The problem is I have NT machine which is useing mm/dd/yy and the
>>>> programs are written for that and we are migrating to Windows 2000
>>>> or XP and those programs fails.....

>>>> Can somebody confirm that yy is not supported anymore on American
>>>> version of W2K or XP?
>>>> thanks

>>>> I need to take care of this as an architecture of the system
>>>> -developer


>>>>> btw I researched this some (out of my curiousity) and found that

>>>>> long date= Friday, June 13, 2003
>>>>> short date= 6/13/2003

>>>>> short date doesn't change from 2003 to 03

>>>>> It seems that mm/dd/yyyy or dd/mm/yyyy and such are defined by
>>>>> your version of windows you have and it appears the American
>>>>> English version of Windows comes default of mm/dd/yyyy.  I guess
>>>>> that dont give you the option of mm/dd/yy due to y2k and those
>>>>> concerns.



>>>>>> I am using windows 2000

>>>>>> I have set the date format in reginal setting in control panel to
>>>>>> m/d/yy short date sample over there is displayed correct 6/12/03

>>>>>> when I use this statement

>>>>>> FormatDateTime(currentdate,2)

>>>>>> it returns me 6/12/2003

>>>>>> it should return me 6/12/03

>>>>>> Pls help

>>>>>> thanks



Wed, 30 Nov 2005 03:57:22 GMT  
 FormatDateTime
you might want to check this out.

http://www.developersdex.com/gurus/code/452.asp

--

need to e-mail me off list just get rid of "your fears" and
drop me a line.


Quote:
> Yes I did change that on server...I am working on server itself....


> > yeah you need to change the regional setting on the server.  ASP is
> > run server side so it will use the setting on the server and not the
> > client machine.



> >> I also get the same correct output when run from Visual Basic

> >> But when I include this in ASP page and run like this

> >> <% RESPONSE.WRITE FormatDateTime(Now, 2) %>

> >> I get 6/13/2003 as output...why asp page is not showing me 6/13/03

> >> any clues?

> >> -developer


> >>> Actually I played more.  If in the control panel, I change the
> >>> regional settings to d/m/yy, my script will run that way.

> >>> in the script:

> >>> DateNow= FormatDateTime(Now,2)
> >>> msgbox (DateNow)

> >>> my output is 6/13/03

> >>> So it does work for me



> >>>> If I can not use m/d/yy or mm/dd/yy then why those options are
> >>>> there? Microsoft should remove this.

> >>>> The problem is I have NT machine which is useing mm/dd/yy and the
> >>>> programs are written for that and we are migrating to Windows 2000
> >>>> or XP and those programs fails.....

> >>>> Can somebody confirm that yy is not supported anymore on American
> >>>> version of W2K or XP?
> >>>> thanks

> >>>> I need to take care of this as an architecture of the system
> >>>> -developer


> >>>>> btw I researched this some (out of my curiousity) and found that

> >>>>> long date= Friday, June 13, 2003
> >>>>> short date= 6/13/2003

> >>>>> short date doesn't change from 2003 to 03

> >>>>> It seems that mm/dd/yyyy or dd/mm/yyyy and such are defined by
> >>>>> your version of windows you have and it appears the American
> >>>>> English version of Windows comes default of mm/dd/yyyy.  I guess
> >>>>> that dont give you the option of mm/dd/yy due to y2k and those
> >>>>> concerns.



> >>>>>> I am using windows 2000

> >>>>>> I have set the date format in reginal setting in control panel to
> >>>>>> m/d/yy short date sample over there is displayed correct 6/12/03

> >>>>>> when I use this statement

> >>>>>> FormatDateTime(currentdate,2)

> >>>>>> it returns me 6/12/2003

> >>>>>> it should return me 6/12/03

> >>>>>> Pls help

> >>>>>> thanks



Wed, 30 Nov 2005 04:05:26 GMT  
 FormatDateTime
Thanks or the nice resource but still the problem is same

why the below line is not working in ASP for m/d/yy

dateme = FormatDateTime(Now, vbShortDate)

thanks

other manipulations looks sensible in the code u have provided....

Quote:

> you might want to check this out.

> http://www.developersdex.com/gurus/code/452.asp



>> Yes I did change that on server...I am working on server itself....


>>> yeah you need to change the regional setting on the server.  ASP is
>>> run server side so it will use the setting on the server and not the
>>> client machine.



>>>> I also get the same correct output when run from Visual Basic

>>>> But when I include this in ASP page and run like this

>>>> <% RESPONSE.WRITE FormatDateTime(Now, 2) %>

>>>> I get 6/13/2003 as output...why asp page is not showing me 6/13/03

>>>> any clues?

>>>> -developer


>>>>> Actually I played more.  If in the control panel, I change the
>>>>> regional settings to d/m/yy, my script will run that way.

>>>>> in the script:

>>>>> DateNow= FormatDateTime(Now,2)
>>>>> msgbox (DateNow)

>>>>> my output is 6/13/03

>>>>> So it does work for me



>>>>>> If I can not use m/d/yy or mm/dd/yy then why those options are
>>>>>> there? Microsoft should remove this.

>>>>>> The problem is I have NT machine which is useing mm/dd/yy and the
>>>>>> programs are written for that and we are migrating to Windows
>>>>>> 2000 or XP and those programs fails.....

>>>>>> Can somebody confirm that yy is not supported anymore on American
>>>>>> version of W2K or XP?
>>>>>> thanks

>>>>>> I need to take care of this as an architecture of the system
>>>>>> -developer


>>>>>>> btw I researched this some (out of my curiousity) and found that

>>>>>>> long date= Friday, June 13, 2003
>>>>>>> short date= 6/13/2003

>>>>>>> short date doesn't change from 2003 to 03

>>>>>>> It seems that mm/dd/yyyy or dd/mm/yyyy and such are defined by
>>>>>>> your version of windows you have and it appears the American
>>>>>>> English version of Windows comes default of mm/dd/yyyy.  I guess
>>>>>>> that dont give you the option of mm/dd/yy due to y2k and those
>>>>>>> concerns.



>>>>>>>> I am using windows 2000

>>>>>>>> I have set the date format in reginal setting in control panel
>>>>>>>> to m/d/yy short date sample over there is displayed correct
>>>>>>>> 6/12/03

>>>>>>>> when I use this statement

>>>>>>>> FormatDateTime(currentdate,2)

>>>>>>>> it returns me 6/12/2003

>>>>>>>> it should return me 6/12/03

>>>>>>>> Pls help

>>>>>>>> thanks



Wed, 30 Nov 2005 04:15:18 GMT  
 FormatDateTime

Quote:

> Yes I did change that on server...I am working on server itself....

INFO: Behavior of Date/Time Format Differs When Accessed from Active Server
Pages (Q306044)
http://support.microsoft.com/default.aspx?kbid=306044

VBScript Date and Time Functions May not be Formatted Properly
http://support.microsoft.com/default.aspx?kbid=264063

PRB: VBScript Date and Time Formats Change with Logged on User (Q218964)
http://support.microsoft.com/default.aspx?kbid=218964

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US

Technet Script Center
http://www.microsoft.com/technet/scriptcenter/default.asp

Microsoft? Windows?2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overvie...



Wed, 30 Nov 2005 07:18:49 GMT  
 FormatDateTime
Thanks Mike for the important resources !
-developer
Quote:


>> Yes I did change that on server...I am working on server itself....

> INFO: Behavior of Date/Time Format Differs When Accessed from Active
> Server Pages (Q306044)
> http://support.microsoft.com/default.aspx?kbid=306044

> VBScript Date and Time Functions May not be Formatted Properly
> http://support.microsoft.com/default.aspx?kbid=264063

> PRB: VBScript Date and Time Formats Change with Logged on User
> (Q218964) http://support.microsoft.com/default.aspx?kbid=218964



Sat, 03 Dec 2005 03:38:49 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. FormatDateTime short date format problem

2. Problem with FormatDateTime

3. FormatDateTime Function

4. formatdatetime problem

5. FormatDateTime (Now (), YY, MM DD)?

6. FormatDateTime

7. FormatDateTime and Regional Settings

8. FormatDateTime() from Javascript?

9. Problem with FormatDateTime(blah, vbShortDate)

10. Need help about FormatDateTime!

11. FormatDateTime

12. problems with FormatDateTime() function

 

 
Powered by phpBB® Forum Software