Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
8 votes
1 answer
257 views

Various existing posts (especially non-C ones) ask why mktime() or timegm() return (time_t)-1 yet only 1 or 2 reasons usually appears: result is out of time_t range or negative. What are all the C ...
chux's user avatar
  • 158k
0 votes
1 answer
47 views

I downloaded custom glibc and then compiled using g++ dt.cpp -std=c++11 -Wl,-rpath "/opt/glibc-2.28/lib", but it gives seg fault #include <iostream> ...
1 vote
1 answer
106 views

I was trying to round-trip a time_t through struct tm *localtime(time_t t) and then time_t mktime(struct tm *tm). #include <stdbool.h> #include <stdio.h> #include <time.h> bool ...
chux's user avatar
  • 158k
5 votes
1 answer
279 views

Considering local time. In testing some time code with the potential hundreds of time zones, some of them result in a mktime() call that never returns for select values! Detail: Code never returns ...
chux's user avatar
  • 158k
0 votes
1 answer
224 views

When attempting to get a time using mktime, I get a overflow exception. This occurs on a Debian docker image, but not on my host machine: docker pull python:3.9.7 https://hub.docker.com/layers/...
1 vote
1 answer
107 views

I am converting a time in string to long time using strptime() and mktime. Strangely, using the same code in two different ways is giving different results. The values of struct tm is same in both the ...
10may's user avatar
  • 328
0 votes
1 answer
142 views

I'm currently getting an Overflow error on the following code when daylight savings is set to true. I've tried a number of date/time combinations and it appears to only be the 9th parameter ("...
stuartp's user avatar
  • 65
0 votes
1 answer
381 views

This question is hinted at in this one, but the answer to that question doesn't answer this question at all, and I've conflicting suggestions and hints scattered around. My problem is relatively ...
0 votes
1 answer
316 views

I'm converting some c++ to c# code. I cannot reproduce equivalent values when converting from the tm struct and mktime() to c#. Example: Both versions use the same values: int year = 2022; int month = ...
1 vote
3 answers
648 views

how can i use the c++ library such as mktime() to convert day to dates instead of making my own algorithm
rob's user avatar
  • 41
1 vote
1 answer
160 views

I am getting an input date from user and convert it into tm struct, (setting is_dst, timezone and gmtoff parameters of tm struct using local time), but when I am using mkTime to get epoch value it ...
Hussey's user avatar
  • 127
0 votes
1 answer
604 views

I want to take a file's epoch timestamp float (e.g., "1661796943.8816772" from "os.stat(__file__).st_mtime"), and convert that float to what I think is called a DateTime string, ...
0 votes
0 answers
314 views

I have two functions for creating a date string, and parsing a date string. The creation works, but the parser seems to add 5 hours to the time. For context, my time zone is EST, 5 hours behind GMT. ...
0 votes
1 answer
201 views

I'd like to convert a string date (UTC) to a timestamp using C++. It works fine except for the month, which is auto incremented by one. If the string is 20221222074648, for 2022年12月22日 07:46:48, the ...
1 vote
1 answer
1k views

I am trying to get the local time in seconds (unix epoch) when a timezone is set. For e.g. 1643371200 is 2022年01月28日 12:00:00 with UTC0 this can be read via gettimeofday(tv, NULL) as seconds with the ...

15 30 50 per page
1
2 3 4 5
...
21

AltStyle によって変換されたページ (->オリジナル) /