redmeat
11-17-2002, 01:19 PM
I'm using MS Access databse to store dates and times, I have fields:
dates: ##/##/####
times: ##:##:##
When viewed in the database, the dates and times are nice and clean, and keep to their input masks, (above). However when I pull them from the database, using ASP, I get this:
If I pull the date field, it gives me the date in word format, and 0's for the time. I don’t want the time, all I specified was the date – and in mm/dd/yyyy format, not words! E.g.
Sun Nov 17 00:00:00 UTC 2002 12:26:45
If I pull the time field from the database I get this:
Sat Dec 30 13:05:32 UTC 1899
Presumably because the time has been set, but the date hasn't.
Why can't I get just the date value that the database shows when viewed directly by opening up the database.
I thought input masks would do the trick, but they seem to do not much at all.
Also, how do I overcome the problem of date or times if their less than 10, taking this format 9, instead of 09?
Many thanks to anyone who can offer their help.
Jack.
/edited because:
If I store them as strings in the database then the format is fine, but not really any use. And that's daft stroing dates as strings when there is a perfectly good format there to deal with dates and time.
dates: ##/##/####
times: ##:##:##
When viewed in the database, the dates and times are nice and clean, and keep to their input masks, (above). However when I pull them from the database, using ASP, I get this:
If I pull the date field, it gives me the date in word format, and 0's for the time. I don’t want the time, all I specified was the date – and in mm/dd/yyyy format, not words! E.g.
Sun Nov 17 00:00:00 UTC 2002 12:26:45
If I pull the time field from the database I get this:
Sat Dec 30 13:05:32 UTC 1899
Presumably because the time has been set, but the date hasn't.
Why can't I get just the date value that the database shows when viewed directly by opening up the database.
I thought input masks would do the trick, but they seem to do not much at all.
Also, how do I overcome the problem of date or times if their less than 10, taking this format 9, instead of 09?
Many thanks to anyone who can offer their help.
Jack.
/edited because:
If I store them as strings in the database then the format is fine, but not really any use. And that's daft stroing dates as strings when there is a perfectly good format there to deal with dates and time.