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

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

Recommended Answers

hey... do this

$time = strtotime('April 1 '.date(Y).' 1:59:59');
echo date("F j Y G:i:s", $time);
Jump to Post

All 4 Replies

Member Avatar

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

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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.