Time() returning hh:mm:ss tt and not HH:mm:ss 
Author Message
 Time() returning hh:mm:ss tt and not HH:mm:ss

Dear All,

In my VBScript server-side code on IIS 5 when I do the time() function, it
is returning hh:mm:ss tt (where tt = AM or PM). However, I would like it to
return HH:mm:ss (as it does on another server of ours).

When I look at the Regional Settings on both IIS servers (development and
main) the format is:

Time Format: HH:mm:ss
Time separator: ":"
AM Symbol: AM
PM Symbol: PM

Can you tell IIS not to use the Regional Settings somehow as it seems not to
be doing this? Any ideas why it isn't using the Regional Setting?

Any help much appreciated.

Regards,

Ben Weeks.

--
Business Advisor & IT Consultant
OPAR Ltd.
+44(0)7968 847 178



Mon, 02 May 2005 18:29:36 GMT  
 Time() returning hh:mm:ss tt and not HH:mm:ss
You may achieve the same result by using


Quote:
> Dear All,

> In my VBScript server-side code on IIS 5 when I do the time() function, it
> is returning hh:mm:ss tt (where tt = AM or PM). However, I would like it
to
> return HH:mm:ss (as it does on another server of ours).

> When I look at the Regional Settings on both IIS servers (development and
> main) the format is:

> Time Format: HH:mm:ss
> Time separator: ":"
> AM Symbol: AM
> PM Symbol: PM

> Can you tell IIS not to use the Regional Settings somehow as it seems not
to
> be doing this? Any ideas why it isn't using the Regional Setting?

> Any help much appreciated.

> Regards,

> Ben Weeks.

> --
> Business Advisor & IT Consultant
> OPAR Ltd.
> +44(0)7968 847 178



Mon, 02 May 2005 19:50:28 GMT  
 Time() returning hh:mm:ss tt and not HH:mm:ss
Hi Ben ,

You may achieve the same result by using

datepart("h",now()) & ":" & datepart("n",now()) & ":" & datepart("s",now())

Regards
Anoj Kumar


Quote:
> Dear All,

> In my VBScript server-side code on IIS 5 when I do the time() function, it
> is returning hh:mm:ss tt (where tt = AM or PM). However, I would like it
to
> return HH:mm:ss (as it does on another server of ours).

> When I look at the Regional Settings on both IIS servers (development and
> main) the format is:

> Time Format: HH:mm:ss
> Time separator: ":"
> AM Symbol: AM
> PM Symbol: PM

> Can you tell IIS not to use the Regional Settings somehow as it seems not
to
> be doing this? Any ideas why it isn't using the Regional Setting?

> Any help much appreciated.

> Regards,

> Ben Weeks.

> --
> Business Advisor & IT Consultant
> OPAR Ltd.
> +44(0)7968 847 178



Mon, 02 May 2005 19:51:25 GMT  
 Time() returning hh:mm:ss tt and not HH:mm:ss
I may have this in a number of places in the code, it would be handy if
there was one way to change it for all the occurrences ... although this is
indeed a good fix if it cannot be done.

Cheers,

Ben.


Quote:
> Hi Ben ,

> You may achieve the same result by using

> datepart("h",now()) & ":" & datepart("n",now()) & ":" &
datepart("s",now())

> Regards
> Anoj Kumar



> > Dear All,

> > In my VBScript server-side code on IIS 5 when I do the time() function,
it
> > is returning hh:mm:ss tt (where tt = AM or PM). However, I would like it
> to
> > return HH:mm:ss (as it does on another server of ours).

> > When I look at the Regional Settings on both IIS servers (development
and
> > main) the format is:

> > Time Format: HH:mm:ss
> > Time separator: ":"
> > AM Symbol: AM
> > PM Symbol: PM

> > Can you tell IIS not to use the Regional Settings somehow as it seems
not
> to
> > be doing this? Any ideas why it isn't using the Regional Setting?

> > Any help much appreciated.

> > Regards,

> > Ben Weeks.

> > --
> > Business Advisor & IT Consultant
> > OPAR Ltd.
> > +44(0)7968 847 178



Mon, 02 May 2005 21:12:26 GMT  
 Time() returning hh:mm:ss tt and not HH:mm:ss
NB The DEFAULT language also needed to be set (was English (US)).


Quote:
> I may have this in a number of places in the code, it would be handy if
> there was one way to change it for all the occurrences ... although this
is
> indeed a good fix if it cannot be done.

> Cheers,

> Ben.



> > Hi Ben ,

> > You may achieve the same result by using

> > datepart("h",now()) & ":" & datepart("n",now()) & ":" &
> datepart("s",now())

> > Regards
> > Anoj Kumar



> > > Dear All,

> > > In my VBScript server-side code on IIS 5 when I do the time()
function,
> it
> > > is returning hh:mm:ss tt (where tt = AM or PM). However, I would like
it
> > to
> > > return HH:mm:ss (as it does on another server of ours).

> > > When I look at the Regional Settings on both IIS servers (development
> and
> > > main) the format is:

> > > Time Format: HH:mm:ss
> > > Time separator: ":"
> > > AM Symbol: AM
> > > PM Symbol: PM

> > > Can you tell IIS not to use the Regional Settings somehow as it seems
> not
> > to
> > > be doing this? Any ideas why it isn't using the Regional Setting?

> > > Any help much appreciated.

> > > Regards,

> > > Ben Weeks.

> > > --
> > > Business Advisor & IT Consultant
> > > OPAR Ltd.
> > > +44(0)7968 847 178



Mon, 02 May 2005 23:16:56 GMT  
 Time() returning hh:mm:ss tt and not HH:mm:ss

Quote:

> NB The DEFAULT language also needed to be set (was English (US)).

You would still be better off in the long run to do you own date/time
extraction and formatting explicitly...

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

INFO: Behavior of Date/Time Format Differs When Accessed from Active Server
Pages (Q306044)
http://support.microsoft.com/default.aspx?kbid=306044?SD=MSDN&FR=0
--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US



Tue, 03 May 2005 02:44:10 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Can not filter items by RecievedTime = dd/mm/yyyy hh:mm:ss

2. Precision in time hh:mm:ss:xx?

3. urgent:adding seconds to time(hh:mm:ss)

4. Precision in time hh:mm:ss:xx?

5. ? How can I define a control similar to the hh:mm:ss on Change date/time

6. Convert time. Second to HH:MM:SS

7. Variable Time Format HH:MM:SS

8. Converting Seconds to hh:mm:ss Format?

9. CDAudio convert tracklength to HH:MM:SS + Button codes

10. converting seconds to HH:mm:ss format

11. How to convert results of datediff to DD:HH:MM:SS

12. converting seconds to hh:mm:ss format

 

 
Powered by phpBB® Forum Software