Forum Moderators: open

Message Too Old, No Replies

How do I write out UTC Time

Displaying UTC on an ASP page

         

dotme

3:51 pm on Jun 2, 2004 (gmt 0)

10+ Year Member



Can anyone help me figure out how to response.write UTC/GMT on an ASP page? This would be a time that is not affected by daylight savings changes etc, so I can't simply offset the Server System Time unless I remember to change that offset twice each year.

I have been digging around for over an hour today on the search engines and just can't find out how to do this.

Thanks in advance!

duckhunter

2:41 am on Jun 3, 2004 (gmt 0)

10+ Year Member



dotme, I can't find a thing either. Every reference I find is refering to the WMI (Platform SDK)

Can you use .NET? The DateTime.ToUniversalTime Method is available and will return what you neeed.

dotme

1:44 pm on Jun 3, 2004 (gmt 0)

10+ Year Member



Found it! Talk about looking for a needle in a haystack. I realize it's a pretty rare need, but in my case I had a windows app deployed behind firewalls in multiple timezones that needed to be timesynced. Since Port 13 NTP wasn't an option (firewalled), I needed a poor-man's http solution. I finally found some free sample code, modified it for what I wanted it to do, and it works. Now the apps can fetch UTC time from the ASP page, and have the optional capability to adjust the PC clock accordingly.

If anyone has a need for UTC on ASP, sticky me and I'll send you the code. It's only 6 lines...lol

Thanks to all who took time to check into this for me!

JD