mktime Questions
1
Solved
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 ...
7
Solved
Am am current facing a problem that need a solution ASAP.
I am trying to list all months of the year by using the following code:
for ($m = 1; $m <= 12; $m++) {
$month = date('F', mktime(0, 0, ...
19
Solved
I want to take a date and work out its week number.
So far, I have the following. It is returning 24 when it should be 42.
<?php
$ddate = "2012-10-18";
$duedt = explode("-",$ddate);
$date = mk...
4
Solved
I am executing below code.
int main()
{
struct tm storage={0,0,0,0,0,0,0,0,0};
char *p = NULL;
p = (char *)strptime("2012-08-25 12:23:12","%Y-%m-%d %H:%M:%S",&storage);
char buff[1024]={0};
...
3
While answering another question, I told the OP he needs to initialize his struct tm variable correctly but needs to be careful because he couldn't simply use
struct tm mytime;
memset(&mytime,...
4
What I would like to do with my simple program is to calculate a difference in seconds between two dates.
time_t referenceDate;
time_t dateNow = time(0);
struct tm referenceDateComponent = {0};
re...
2
Solved
When you call mktime(), Feb 1 seems to come before Jan 31. Why is this? Am I doing something wrong or is this a bug in glibc?
Here's the code:
struct tm tm;
time_t tt;
memset(&tm, 0, sizeof(...
2
Solved
I'm working on some time related features and I opt to always use UTC times and store time stamps as integers for consistency.
However, I noticed that when I use mktime it seems that the currently...
3
Solved
4
Solved
I'm trying to use PHP to create a script that searches all the days between now and one year's time and lists all the dates for Fridays and Saturdays. I was trying to use PHP's date() and mktime() ...
1
Solved
I have been playing with mktime, and I noticed a weird, and inconsistent, behavior.
I provide it with a date which is not during DST (daylight saving time), but with tm_isdst is set to 1, what mkt...
8
Solved
Hay, i have a database holding events. There are 2 fields 'start' and 'end', these contain timestamps. When an admin enters these dates, they only have the ability to set the day,month,year. So we ...
2
Solved
I am trying to figure out what's special about March 16th, 1984. On a virtual machine I am using (nothing special about it), Python (as well as PyPy) crashes when trying to use mktime with what see...
1
Here is my problem: polyfit does not take datetime values, so that I converted datetime with mktime producing the polynomial fit works
z4 = polyfit(d, y, 3)
p4 = poly1d(z4)
For the plot however...
Nordgren asked 14/7, 2013 at 9:27
1
Solved
Are there any differences between using functions time() and mktime() with default parameters to obtain current timestamp?
5
Solved
I am trying to convert a date from dd/mm/yyyy => yyyy-mm-dd. I have using the mktime() function and other functions but I cannot seem to make it work. I have managed to explode the origina...
Glassworker asked 24/4, 2012 at 22:36
1
Solved
I read in two strings with a Year, the Julian Day (year day), hour, minute, and an observation.
I pull the relevant variables out using sscanf:
sscanf(tide_str1.c_str(), "%d %d %d %d %Lf", &y...
1
For the first time (in my new dev environment) I'm seeing valgrind complain about mktime, but I'm not sure if this is a bug in the libc library, valgrind, or my code. I'll start with the error (bel...
4
Solved
2
Solved
I am using the mktime(struct tm*) function in Suse 10.
Now, I am noticing some strange behaviour when daylight saving time is enabled. Let's say I have enabled daylight saving time to begin on Se...
2
Solved
3
Solved
strtotime() in PHP works great if you can provide it with a date format it understands and can convert, but for example you give it a UK date it fails to give the correct unix timestamp.
Is there ...
3
Solved
I'm trying to group together dates into a week number and year, and then I want to convert that week number back into a unix timestamp. How can I go about doing this?
3
Solved
I have the following MySQL timestamp:
2009-06-23 16:21:48
How can I convert it to a format like mktime()?
4
Solved
I need to query MySQL for the current date (from PHP) in YYYY-MM-DD format... anyone?
1 Next >
© 2022 - 2025 — McMap. All rights reserved.