Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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 ...
Lazouache Farid's user avatar
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....
user avatar
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) = ...
Mostafa M.K_Soft's user avatar
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 = $...
Chauhan's user avatar
  • 2,581
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 ...
Andrea Otto's user avatar
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 ...
barak manos's user avatar
  • 30.1k
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 ...
Drifter64's user avatar
  • 1,123
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 = ...
Patrioticcow's user avatar
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, ...
Mr. B.'s user avatar
  • 8,657
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 ...
davidlee's user avatar
  • 6,167
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 ...
dotty's user avatar
  • 41.3k
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 ...
James's user avatar
  • 6,008
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()?
user avatar