The results of such subtraction is a timedelta object The timestamp returned by time.time() is not in any timezone Seconds since the epoch is a term It is not elapsed seconds since some point in time (epoch) You can convert it to your local time (with tz database) and/or utc timezone easily Yes, time can be captured in utc alone
I suppose it’s up to each state of the us to define its time And i don’t know, but i suppose that today they (officially or in practice) define time as an offset from utc rather than gmt. Timestamp is always in utc New date().tostring() will show you current time zone time representation, new date().toutcstring() will show you utc time repr, but new date().gettime() is always utc, because that is what unix time is defined as Unix time (also known as posix time or epoch time) is a system for describing instants in time. By definition the c time() function returns a time_t epoch time in utc
The resulting utc object isn't really a utc date, but a local date shifted to match the utc time (see comments) However, in practice it does the job With advancements in javascript, better approaches exist. Assume i have this string It does store the correct physical point in time, but it is a local time and will be printed in local time Note that this still is a correct answer to the question
Op did not specifically ask for creating a datetime object with kind utc. Problem it looks like when i use the format() function, it automatically convert the original utc time into my timezone (utc+8) I have been digging through their docs for hours and couldn't seem to I want to send a time point over a network connection to detect the ping time and for other calculations The time has to have millisecond precision, but using
WATCH