Some time ago, the project involved the conversion between MySQL and MSSQL data types. Recently, I was studying Sina Weibo's API, which involved the conversion of GMT time types with time zones, this is a special record for future query.
I.
In the use of the Vertica database, a scenario is encountered in which the program collects data from the cluster in the same area and writes the same table, and then we need to display the data in GMT time. At this point we can provide the time
GMT: Hotell gyllene Geten Standard TimeBeijing Time =gmt time + 8 hoursDatatime nowdate = Datatime.now;Nowdate.tostring ("R"); Effect: Wed, 16:24:33 GMTExplanation of the parameters:D ShortDatePatternD LongdatepatternF Full Date and time (long date
Today, a strange problem has been encountered on the server side through C # get the current time for Fri 09:37:46 CST 2009, converted toGMT time: 01:37:46 GMT, that is, GMT time plus 8 hours equals the time indicated by CST, that thisCST is not
Today, when I got the "last modified" time of windchill, we found that GMT time was obtained, but we used to use CST time.Initial attempt to set directly to CST time zone, Timezone.gettimezone ("CST"), found 8 hours less than GMTBeijing Time is East
Ordinary time conversion problem I here is no longer wordy, I think everyone should be that kind of low-level conversion problem, now I would like to summarize how to convert GMT time format, this format conversion method is not a lot of online, so
1.UTC Time and GMT time
We can think of GMT as time Coordination Time (GMT=UTC), GMT and UTC time are calculated in seconds.
2.UTC Time and Local
UTC + time Zone difference = local time
Time zone Chadong is positive, West is negative. Here, the
The system time and local time were not always correct when the machine was debugged, and the beginning thought it was time error,
Then find the use of Ntpdate-u 211.115.194.21 synchronized network time, but still wrong, compared with the local
JS Time zone function:Set Datename to a Date object created====================Datename.gettimezoneoffset ()--Gets the difference between local time and GMT time (GMT) and returns the value in minutes====================For example: Obtain GMT time
Js time zone functions:
Set datename to a created Date object
================================Datename. getTimezoneOffset ()-- Get the difference between the local time and GMT time (Greenwich Mean Time). The return value is in minutes.==============
Js time zone functions:Set datename to a created Date object================================Datename. getTimezoneOffset ()-- Get the difference between the local time and GMT time (Greenwich Mean Time). The return value is in minutes.================
In js, we generally talk about the time difference between Greenwich Mean Time and local time, in minutes. This is no different from php and asp. Next we will combine date () function to introduce js Time Zone issues
Js time zone functions:Set
Definitions and usageThe getTimezoneOffset () method returns the difference in minutes between Greenwich and local time.
GrammarDateobject.gettimezoneoffset () return valueThe time difference between local time and GMT times, in minutes.
In the
Jump out of NSDate, nsdate
I feel that there are many time zones for formatting in any language, and it has been plagued by various NSDate problems for a long time.
Let's take a look at the NSDate issue.
1. NSDate
NSDate get current time
NSDate *
Feel any language about time format processing, time zone processing are many, recently been nsdate of various problems pit for a long Let's take a look at NSDate's own questions. 1.NSDate NSDate Get current time NSDate *date=[nsdate Date];[NSDate
System Environment: ubuntu10.041. Common time types under Linuxtime_t, struct TM, struct timeval, struct TIMESPEC1.1 time_t Time TypeThe time_t type is defined in Time.h:typedef long time_t;Visible, time_t is actually a long integer type. Its value
Now there is a cross-Time Zone application. users logging on to different time zones need to view their own time zones and switch between time zones.
My idea is that all the stored time in the system is GMT (UTC) time. When a user logs on, the
Int
Mktime([Int
$ Hour[, Int
$ Minute[, Int
$ Second[, Int
$ Month[, Int
$ Day[, Int
$ Year[, Int
$ Is_dst])
Returns the Unix timestamp Based on the given parameters. The timestamp is a long integer that contains the number of seconds from the
Meaning of time strings in NSDateFormatter, nsdateformatter
A: AM/PM (morning/afternoon)
A: 0 ~ 86399999 (the second microsecond Of A day)
C/cc: 1 ~ 7 (the first day of the week, the day of the week is 1)
Ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat
Magento date and time functionsMagento date-related methods are mainly in two files. One is the core/date model class, and the other is the core assistant class. The methods are as follows.ExampleMage: getSingleton ('core/date ')Mage: getSingleton ('
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.