Questions tagged [mktime]

mktime is a function that returns the time since the UNIX epoch from a given date and time. Found in C and PHP.

Reference for the C function: https://en.cppreference.com/w/c/chrono/mktime

Reference for the PHP function: https://php.net/manual/en/function.mktime.php

308 questions
0
votes
2 answers

localtime() gets it wrong, says date = September 31

I am making a calendar program. The 'expand repeating events' code is giving me no end of trouble. I am expanding events by using mktime() to get a 'pure' time value, then adding the repeat delta (in this case, 604800 seconds or 7 days) to it.…
SoItBegins
  • 414
  • 1
  • 6
  • 22
0
votes
3 answers

Deprecated: mktime(): The is_dst parameter is deprecated

standard function: ( see on codepad )
bernte
  • 1,184
  • 2
  • 19
  • 34
0
votes
1 answer

mktime, date() or mysql timestamp for a forecast?

I have a simple MySql DB with some logdata. I want get a forecast for events that repeats +-30min on a Weekday. eg: I compare 3 Events that match the criteria and give a alert. And now the Question: What is the best method to compare the time? I can…
sarahsdev
  • 177
  • 6
  • 22
0
votes
1 answer

How to correct dates stored with mktime() now that daylight saving has changed them all to the day before

I wrote a web application that used the following to store a date: $event->date = mktime(0, 0, 0, $month, $day, $year); where $month, $day, $year came from dropdown selectors i.e. where integer values. So I was storing dates represented by midnight…
andyg1
  • 1,455
  • 3
  • 13
  • 21
0
votes
3 answers

Calculate hours difference between today and 4/3/NextYear

I want to calculate the difference between today and next year April 4 (right now is 4/4/2013), but I don't know how to create a DateTime object using actual year + 1. This is what I have: $now = new DateTime(); $ref = mktime(0, 0, 0, 4, 3,…
Tomas Ramirez Sarduy
  • 17,294
  • 8
  • 69
  • 85
0
votes
2 answers

Issue with using ctime to advance a given date to next calendar date

I wrote the following piece of code to advance the input date to the following calendar date. This works well when tested in a dummy source file compiled with g++ 4.1.2 However, when running the following code from within my firm's…
Mindstorm
  • 443
  • 1
  • 5
  • 12
0
votes
1 answer

can't insert event starting on a defined date into fullCalendar

I'm working on a codeIgniter project.I use fullCalendar to insert events. The concept that I want to implement is similar to google Calendar. When a user clicks on a day in the calendar, he inserts an event starting on the date of the clicked day.…
user1499220
  • 419
  • 4
  • 12
  • 23
0
votes
1 answer

Get Day, Month, Year separately from mysql in mktime format

I have a mktime code for adding date into database. This code display current date separately in mktime format.