DateTime field in SqlMobile database

  • Thread starter Thread starter davebythesea
  • Start date Start date
D

davebythesea

Hi folks,

Just a quick question regarding the DateTime type and how it is stored in a
Sql Mobile database.

When a DateTime value is stored in the database, is it always stored in the
same format?

I had a look at a DateTime value in my mobile app's database and it looks
like this when viewed through Query Analyzer -

2007-11-15 00:00:00

Will the DateTime values always be stored in this format?

When I display that value in a data grid cell it looks like this -

11/15/07

I would prefer it says - 15/11/07. But to do that would I have to store the
value differently, or somehow display it differently?

Thanks for any tips,

Dav
 
To be honest it shouldn't really matter to you what format the datetime is
stored in unless you are using long-hand queries. To my knowledge the
datetime is always stored in the ISO 8610 format.

Just a guess to format the date in the datagrid, have you tried the
CurrentCellChangedEvent then formating there? I never use the datagrid so
there might be a better solution.
 
Hi, thanks for the reply. I think it maye be the data grid which is giving me
the problem. I'm using a third party datagrid component, which i think is
changing the date time format. I'll probably just have to configure it, to
get the correct format displaying.

Cheers,
David
 
See if it is possible to set the locale for the data grid as it seems to be
in American style MM/DD/YY. Seems you want it in British format DD/MM/YY.
also check what locale the device is set to.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com
 
I found the problem I was having. It was simply that the regional settings on
the device where not set to English (United Kingdom). I thought that setting
the timezone to GMT in teh clock settings was enough but the Regional
settings also have to be set. That has fixed everything.
 
Back
Top