[Time Zone] ConvertFromTimeZone

[Time Zone] ConvertFromTimeZone

Forge Component
Published on 2016-10-11 by André Vieira
6 votes
Published on 2016-10-11 by André Vieira
I'm using the ConvertFromTimeZone action to convert from the current system time zone, to my time zone; however, the ConvertFromTimeZone action asks for the SourceTimeZone to be in a text format. How can I get the current system's time zone into the SourceTimeZone?

check the sample application. You have there the information about the system time zone and how to convert to other time zones. You should probably use GetCurrentTimeZone to get the system time zone...
I'm still a bit confused. What am I supposed to write (because it asks for a Text data type):
 ConvertFromTimeZone( ,Here, And Here)
Having an example in the Action Description would be good.

Hi Carlos,

You are right! The parameters of this action are missing some description :(
These are supposed to be identifiers of the TimeZoneInfo in C#.
You can validate how to use this action in the TimeZone module:
  • Open the screen in the MainFlow.
  • Double click the expression next to the  'Converted Data Time' label.
This expression uses this action.

Hope this helps, If not please share your module so that I can have a look and see what's missing...
how exactly am I supposed to write the TimeZone name in ConvertFromUTC(DateTimeUTC,TimeZone)?

Someone told me to use the names shown here:

I don't really think that's how it works so...
Use the test page to determine the identifier you want (http://andrevieira.outsystemscloud.com/TimeZone/)
From the drop down select the timezone you want and below you will see the identifier which is the value you should use.

Hello Andre,

how would it be in case that I have many users entering from different timezones? and How can I change the time format from YYYYMMDD HH:MM:SS to MMDDYYYY HH:MM AM/PM ?


HI Alvaro,

You should store your dates in UTC and convert them to the timezone of each user for display only. The way you manage this can be by automatically determining the timezone from the browser or the device or by a user configuration in the backoffice. Either way, you need to program for this.

Regarding the format it is independent of the timezone conversion since the timezone returns a DateTime. You can use the FormatDateTime function for that.