Zum Hauptinhalt gehen

Date always converts back to UTC

Kommentare

4 Kommentare

  • Permanently deleted user

    I have the same issue. Is there anyone solve this problem ?

    0
  • Permanently deleted user

    Thanks for sending this John.

    0
  • Permanently deleted user
    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
  • Permanently deleted user
    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.