Jump to content

Date/time formatting and timezones


Martin Stevnhoved
 Share

Recommended Posts

  • Administrators

Hi Martin,

SimpleItem is like a label, it will render the text exactly as you send it. If you want the datetime to be local you to the mobile app you could use the DateTimePicker instead (even if you just want to show it).

-Paul

Link to comment
Share on other sites

Hi Paul.

Perhaps you could give me a quick example.

I have the same challenge with DateTimeInputItem.

System.DateTime datelocal = System.DateTime.Now;
System.DateTime dateutc = datelocal.ToUniversalTime();

Groups result = new Groups();
Group group = new Group("More Information");
group.Items.Add(new DateTimeInputItem("local", datelocal.ToString()));
group.Items.Add(new DateTimeInputItem("utc", dateutc.ToString()));
result.Add(group);

When running the above on a server in UTC+8 and showing it on a mobile device in UTC+1 it gives me the attached result.

I would like a function that converts the time to the mobile device Time Zone.

Annotation 1 is my phones local time (UTC+1)
Annotation 2 is the servers local time (UTC+8)
Annotation 3 is the servers universal time (UTC)

Br, Martin.

 

 

2016-11-12 13_44_25-2016-11-12 13.38.21.png

Link to comment
Share on other sites

  • Administrators

Hi Martin,

You are correct, sorry for the confusion. We don't support timezone conversion for plugin labels however this would be a great addition so we will definitely consider it for a future release.

-Paul

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...