need to write the below javascript function in php..please help

myStartDate = new Date('April 1, '+curYear+' 1:59:59');

Recommended Answers

All 4 Replies

Member Avatar for P0lT10n

What do you need to show ??? only year ???

use mktime() or strtotime().

strtotime('April 1 ' . date(Y) . ' 1:59:59');

this would get you paril 1 of the current year at 1:59:59.

use mktime() or strtotime().

strtotime('April 1 ' . date(Y) . ' 1:59:59');

this would get you paril 1 of the current year at 1:59:59.

It is giving 1270067399 i want like this
Tue Apr 01 0110 01:59:59 GMT+0530 (India Standard Time)

Member Avatar for P0lT10n

hey... do this

$time = strtotime('April 1 '.date(Y).' 1:59:59');
echo date("F j Y G:i:s", $time);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.