Created
March 24, 2019 17:52
-
-
Save pracps/db6fb74a123d024498865d1043968045 to your computer and use it in GitHub Desktop.
Location specific time parsing
This file contains hidden or 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
loc, _ := time.LoadLocation("Asia/Kolkata") | |
format := "Jan _2 2006 3:04:05 PM" | |
fp1_time_string := "Mar 15 2019 06:30:00 AM" | |
fp2_time_string := "Mar 15 2019 10:30:00 AM" | |
fp1_time, _ := time.ParseInLocation(format, fp1_time_string, loc) | |
fp2_time, _ := time.ParseInLocation(format, fp2_time_string, loc) | |
log.Println(fp1_time) | |
log.Println(fp2_time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment