R
rn5a
The date in my local machine is set to the dd/MM/yyyy format. When I
insert a date in a MS-Access DB table, it gets populated in the above
format. For e.g. if the date is, say, 8th March 2007, it gets
populated in the DB table as
08/03/2007
In other words, first the day is shown, then the month & finally the
year but when I retrieve it in ASP.NET & using DatePart, try to
extract the day & the month like this (assume that the date record
from the DB table is stored in a variable named dtOrderDate)
Response.Write("Day: " & DatePart("d", dtOrderDate))
Response.Write("Month: " & DatePart("m", dtOrderDate))
the first Response.Write outputs the day as 03 & the month as 08 where
as it should be the other way round i.e. the day should be 08 whereas
the month should be 03. The day & month values get reversed when I
just do Response.Write(dtOrderDate).
Can someone please point out what am I missing?
insert a date in a MS-Access DB table, it gets populated in the above
format. For e.g. if the date is, say, 8th March 2007, it gets
populated in the DB table as
08/03/2007
In other words, first the day is shown, then the month & finally the
year but when I retrieve it in ASP.NET & using DatePart, try to
extract the day & the month like this (assume that the date record
from the DB table is stored in a variable named dtOrderDate)
Response.Write("Day: " & DatePart("d", dtOrderDate))
Response.Write("Month: " & DatePart("m", dtOrderDate))
the first Response.Write outputs the day as 03 & the month as 08 where
as it should be the other way round i.e. the day should be 08 whereas
the month should be 03. The day & month values get reversed when I
just do Response.Write(dtOrderDate).
Can someone please point out what am I missing?