Jump to content

Is there an easier way to work with unix timestamps?


writer

Recommended Posts

I'm having a lot of trouble wrapping my head around PHP's mktime function.

 

I've got a a few difficult tasks (for example, pull all records filed on a Tuesday this year) and was wondering if there's a class library out there somewhere that can cut down my development time.

 

Anyone know of an easier way to work with unix timestamps in PHP?

can anyone help me figure out how to establish the first and last day's of the month?

 

<?php
$num = date("t"); //number of days in the month.

$firstDayTime= mktime(0,0,0, date('n'), 1, date('Y')); // First day of the month

$lastDayTime= mktime(0,0,0, date('n'), $num, date('Y')); // Last day of the month
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.