These days I have encountered a huge pit. The time of data storage is 2 o ‘clock, but the time displayed on the front page is 16 o ‘clock, which is 14 hours short.
Describe the project background, the service is in the US, the project is a Mexican project, the database time and server time have been set to the Mexican time zone, but it is still not correct.
I have asked the project boss in the middle, and the boss gave me the opinion that the time zone was set on the URL of connecting data, but the front-end page was still not displayed correctly.
After several times of locating, the time to find it directly in the dev location will change. This is because the computer’s time zone is the Chinese time zone. But the time log is still on the server, the log time is correct. So guess the front-end is the time zone problem.
Because the last segment passes the timestamp, the timestamp has no time zone. So the front end also needs to change the time zone to correspond
id : "crete_time",
renderer : function(idValue,value,record){
return value ?moment(value).tz("America/Guatemala").format("YYYY-MM-DD HH:mm:ss") : "---";
}
You can set the time zone using the Moment.tz method
Read More:
- Jsonformat annotation solves the problem of time format in the front end of localdatetime
- After switching the tidb database, an error could not commit JDBC transaction appears from time to time
- The back end cannot receive the parameters passed by the front end
- When calling time module – time / datetime in wxPython, an error is reported. Valueerror: unknown locale: zh cn
- How to get the current time in java time string
- Nginx front end and back end separation + service cluster reverse proxy
- The problem of [connection lost contact] after C # code connecting Oracle database for a period of time
- In SQLite database, set the default value for the field as the current time
- Front end project runtime prompts syntax error: typeerror: token.type.endswith is not a function solution
- After IOS upgrade, the time control selected by the wheel will be invalid, uidatepicker
- SQL query time group_ Was cut by group_ CONCAT()
- [antdv: DatePicker] `value` provides invalidate moment time. If you want set empty value, use `null`
- Springboot time zone problem
- Error (1820) if the password is not changed in time after MySQL installation
- Decipher the evolutionary path of junior, middle and senior programmers (front end)
- Hide print button when printing page in front end
- Solution to prompt run time error “438” when a VB program is opened
- Local date time conversion in java8
- What are the web front end technologies? What are the differences between cookie and session
- Front end Vue project operation error module build failed