I’m working on an ASP (Classic) application using MS SQL as database.
In the database I got 2 values storen StartTime and EndTime
StartTime EndTime
1899-12-30 09:30:00.000 1899-12-30 17:00:00.000
The thing is, when I read those values from the database and write them on my page
rsSessions.fields.getValue("StartTime")
I get the following result:
09:30:00 AM
05:00:00 PM
While I would need a normal short 24h format.
It seems to me that ASP formats the time by itself here, is there any way to disable this without having to change the code?
This has to do with the locale of the server. ASP Classic formats numbers, currency and dates accordingly.
You can setup a specific locale by using:
See ASP LCID Property for some more info. A list with locales can be found here.
For my own code I tend to convert a string to a date:
After that I can decompose the date and assemble it in any way I need. Take a look at the Date/Time Functions here.