All Questions
13 questions
0
votes
1
answer
172
views
Month auto increment using mktime and timegm functions in C++
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
814
views
Unexpected value returned from mktime() [duplicate]
I prepare the following structure :
struct tm tDepartureTime;
tDepartureTime.tm_min = 24;
tDepartureTime.tm_hour = 13;
tDepartureTime.tm_mday = 11;
tDepartureTime.tm_mon = 2 - 1;
tDepartureTime....
1
vote
0
answers
150
views
work with jmktime in JDF library
I have a problem with converting Jalali date to timestamp. For do that i'm using JDF library. So far I've Done this:
$jalalidate = $this->input->post('c_adddate');
list($year, $month, $day) = ...
0
votes
3
answers
669
views
Diffrence between two time stamp if hour greater than 24 [duplicate]
I just edit my question
I have have two time format i want the difference between them
For example
$time1 = new DateTime('09:00:59');
$time2 = new DateTime('100:30:00');
$interval = $...
0
votes
1
answer
106
views
Timestamp mktime php format
I have a php page listed below with events and I wish to order them by dates. No problem with this, but I want the date format was "15/Lug/1998" and not "15/Lug/1998:00:00:00 -0000". I post the code ...
5
votes
1
answer
6k
views
Convert between date/time and time-stamp without using std library routines
I am trying to implement in C two simple convertors, date/time to time-stamp and vice-versa, without any dependencies on time library routines (such as localtime, mktime, etc, mainly due to the fact ...
0
votes
2
answers
538
views
NASM: Getting the day of the week a different date
I have been tasked with writing a NASM program that gets the day of the week for the first day of the next month. As an example: If today is June 4, then the program should say something like:
July ...
4
votes
5
answers
50k
views
how to convert date and time to timestamp in php?
i have a date '07/23/2009' and a time '18:11' and i want to get a timestamp out of it :
here is my example:
date_default_timezone_set('UTC');
$d = str_replace('/', ', ', '07/23/2009');
$t = ...
2
votes
3
answers
828
views
PHP: How to create a timestamp from pattern H:i (17:45)?
my current code:
<?php
$timestamp = DateTime::createFromFormat("d.m.Y H:i", $_POST["datetime"]);
echo $timestamp; // works!
?>
Now I've a form with two fields: date and time, ...
0
votes
2
answers
1k
views
problem with mktime and timezone
I would like to display the time stamp of 00:00:00 1 Nov 2010 with the code as below
$day = mktime(0,0,0,11,1,2010);
However, it always display the wrong timestamp from what I intended.
For ...
31
votes
8
answers
65k
views
Finding days between 2 unix timestamps in php
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 are ...
0
votes
2
answers
794
views
PHP swap month and day in timestamp
Right. I was inserting a load of data into a MySQL DB and used the following to generate the timestamp:
$stamp = mktime($t[0], $t[1], $t[2], $d[2], $d[1], $d[0]);
Unfortunately, the day and month ...
2
votes
3
answers
11k
views
convert mysql timestamp to mktime
I have the following MySQL timestamp:
2009-06-23 16:21:48
How can I convert it to a format like mktime()?