Jump to content

[SOLVED] escaping characters in DATE() function, setting timezone help


dsaba

Recommended Posts

i'm using the date() function

I need to know how to set the timezone to London, UK

which is GMT +1 hour

 

IN PHP 4

 

 

also I need to know how to escape characters in the date() function

characters that need escaping are: "/" and ":"

I tried \/ backslashing to escape but didn't work

right now i'm making seperate values for each part of my date, and concacting them

it would be easier for me to use the date function like: date(m/d/y:h) ...etc....

but i would need to know how to properly escape those characters

 

here's my code:

$month = date(m);
$day = date(d);
$year = date(Y);
$hour = date(h);
$minute = date(i);

echo $day.'/'.$month.'/'.$year.':'.$hour.':'.$minute;
//displays like:   07/04/2007:03:03

 

-thank you, I am confused after reading the php manual

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.