DateTime field in SqlMobile database

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
 
S

Simon Hart [MVP]

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.
 
D

davebythesea

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
 
S

Simon Hart [MVP]

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
 
D

davebythesea

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top