Oct
02
2010

ValueConverter example for TimeZones

User Rating: / 0
PoorBest 

Just added another Wiki article on how to store your Dates as UTC and display them as Local time in your apps (with two way binding, as in you pass a Local Time and it will be stored as UTC)

http://wiki.alfware.com.au/XPO+-+Store+dates+in+database+as+UTC+display+in+Local+Time

Hope this helps someone at some stage

Comments  

 
0 # 2010-10-02 06:24
I recall a late night twitter conversation we had about this. I don't recall what the difference was between your implementation and the built in UTC converter in XPO was. Refresh my memory if you recall.
Reply | Reply with quote | Quote
 
 
0 # Michael Proctor [Dx-Squad] 2010-10-02 06:38
Dennis,
You have just re-inforced why the Wiki will be handy ;) Yes in the DevExpress.Xpo.MetaData namespace there is a UtcDateTimeConv erter which does what this does ;) I just keep forgetting the bugger is in there

Will update the Wiki to use the inbuilt converter. thanks for reminding me (again)
Reply | Reply with quote | Quote
 
 
-1 # 2010-10-02 06:43
Well I'm starting to recall the difference. I think you mentioned something about the XPO one using the current machines TZ, but since you had traveling users, you needed the ability for them to specify which TZ they were currently in at login to your application.
Reply | Reply with quote | Quote
 
 
0 # Michael Proctor [Dx-Squad] 2010-10-02 06:49
Yeah but I didn't go into that in the Wiki article ;) but your right, when you descend your own Date converter you can adjust what "Offset" you would like your dates "converted" to.

However for the purpose of that Article I will change it to say to use the XPO Inbuilt one for a simple UTC to Local converter, but show how you can make your own converter and specify a UTC Offset. ;) more work to be done
Reply | Reply with quote | Quote
 

Add comment

Although I believe your free to say what you want, please don't abuse either myself or other peoples, be constructive.


Security code
Refresh

Latest Comments

My Twitter

Follow me on twitter