Date always converts back to UTC
Hi there,
not sure if anyone else has run into this issue or not, but it's doing my head in!
I have a date picker control on the form, and it returns the date, which by default looks to be UTC (so 10 hours behind us). I convert the date to our local time with an assign..
obsLocalTime = obsDate.ToLocalTime() (where obsDate is the result of the date picker)
I then update the table field with
myGraphic.Attributes("OBS_DATE") = ObsLocalTime
I even put an alert in the workflow to print the new 'local' time and it comes up correctly, yet when I submit my changes as part of the new 'Add Features' editing workflow activity - the result in ArcMap and SqlServer reverts back to UTC all the time....
I've tried hard coding text entries with assign activities... ie. CDATE("05/17/2012 10:56:00 AM") but again, arcmap will present the time 10 hours behind us.
The GE server, SDE, and the SQL Server boxes are all English(Australia) locales...
any ideas how I can get a non UTC time saved!
cheers
Gareth
-
I have the same issue. Is there anyone solve this problem ?
0 -
Thanks for sending this John.
0 -
For anyone still have the issue and found this post. I had a featureserver layer and it had a datetime type field. when using Workflow form it always converts the input date to UTC. I end up converting the the Nullable<DateTime> to DateTime and then converted to String! like CDate(inputDateFromForm).ToString(dd/MM/yyyy)
Note I didn't turn on Enable Editng Tracking of the feature class nor set the datetime to be UTC.0 -
Just extend this a bit, if the DateTime object is created on server-based activity (e.g. Assign), and the server's timezone is set to UTC. Then I would use the following code to convert the DateTime object to my preferred timezone. TimeZoneInfo.ConvertTime(Date.Now, TimeZoneInfo.FindSystemTimeZoneById("E. Australia Standard Time")).ToString("dd-MM-yyyy hh:mm")0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
4 Kommentare