Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
WeeLH
19
Views
2
Comments
[Geo] Error when invoking Timezone_ConvertTimezoneByCode
Question
Forge
Geo (O11)
Forge asset by
Geo Team
When invoking this action
Timezone_ConvertTimezoneByCode, encountered below error:
The time zone ID 'Etc/GMT' was not found on the local computer.
Anyone faced this and what is the problem?
Robert Chanphakeo
Hello Lian
This error occurs because the server where you installed GEO component does not have ETC/GMT win32 timezone, a better solution would be to modify the internal GEO Timezone_ConvertTimezoneByCode method to use Nodatime class library
https://nodatime.org/
Robert Chanphakeo
Lian
Try the code below, let me know if you have any issues.
/// <summary>
/// Convert UTC DateTime into another timezone.
/// </summary>
/// <param name="ssUTCDateTime"></param>
/// <param name="ssToTimezoneCode"></param>
/// <param name="ssToDateTime"></param>
public void MssGeo_ConvertUTCTimezone(DateTime ssUTCDateTime, string ssToTimezoneCode, out DateTime ssToDateTime)
{
ssToDateTime = new DateTime(1900, 1, 1, 0, 0, 0);
DateTime utcDateTime = TimeZoneInfo.ConvertTimeToUtc(ssUTCDateTime);
var resultTimeZoneId = DateTimeZoneProviders.Tzdb[ssToTimezoneCode];
DateTime resultDateTime = Instant.FromDateTimeUtc(utcDateTime).InZone(resultTimeZoneId).ToDateTimeUnspecified();
ssToDateTime = resultDateTime;
} // MssGeo_ConvertUTCTimezone
Note: I havent tested it.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...