0

I have this code: date("d/m-Y", strtotime('+17 days', time())); But i need to convert it to a timestamp with no specifik time.

The case is i need to test if the timestamp is equal to one i have in my database. Just to be clear, the time that's created above, is from today, 30 Juli, 2015 and the timestamp i have in my database is: 1438214400 (Also 30 juli, 2015)

Is it possible to make date("d/m-Y", strtotime('+17 days', time())); a timestamp so that will be equal to my timestamp in my database?

Best regards

Rasmus Kjeldsen
  • 161
  • 2
  • 13
  • what time in timestamp in your DB - 00:00:00 or time of inserting record? – splash58 Jul 13 '15 at 07:54
  • `date("d/m-Y" ` is already without a time associated with it, so what's the issue? – Hanky Panky Jul 13 '15 at 07:56
  • Yea i know it's without date, but it's just how to handle it, because when i put it into the mktime function, the timestamp i get is wrong. The timestamp in my database is made with: `$today = mktime(0, 0, 0, date('m'), date('d'), date('y'));` – Rasmus Kjeldsen Jul 13 '15 at 07:57

1 Answers1

0

I figured it out, the solution was to

$fromnow = date("d-m-Y", strtotime('+17 days', time())); list($day, $month, $year) = explode('-', $fromnow);

$timestamp = mktime(0, 0, 0, $month, $day, $year);

Thank you so much for your reply's

Rasmus Kjeldsen
  • 161
  • 2
  • 13