Jump to content

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


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.