Created
March 18, 2024 02:06
-
-
Save farithadnan/5a7a0d0a2cc5460b526fbef62b957c69 to your computer and use it in GitHub Desktop.
Get a current datetime for Kuala Lumpur (Malaysia)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace test_datetime | |
{ | |
internal class Program | |
{ | |
private static TimeZoneInfo Kuala_Lumpur_Standard_Time = TimeZoneInfo.FindSystemTimeZoneById("Singapore Standard Time"); | |
static void Main(string[] args) | |
{ | |
DateTime datetime_kuala_lumpur = TimeZoneInfo.ConvertTime(DateTime.UtcNow, Kuala_Lumpur_Standard_Time); | |
Console.WriteLine("Kuala Lumpur Now: " + datetime_kuala_lumpur); | |
Console.WriteLine("Kuala Lumpur + 1 Hour: " + datetime_kuala_lumpur.AddHours(1)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment