...

View Full Version : Text in date() function



teaorcoffee
02-16-2010, 09:44 PM
Hi

I want the function to return something like:

Tue 16 February 2010 at 20:20:16 GMT

but can't quite get it right. It's the text "at" in the middle that's causing the problem.

Here's an example of the code:

$now=date("D j F Y \a\t G:i:s T");

If I present "at" as \a\t the "t" is (I think) treated as a tab. If I don't esacpe the "t" I get the number of days in the month and not a letter "t". How do I get the letter "t" to show?

FYI I am on the verge of undertaking what I think is a failure activity and splitting the date command into two commands and concatenating "at" in the midlle!! lol )

Len Whistler
02-16-2010, 10:09 PM
FYI I am on the verge of undertaking what I think is a failure activity and splitting the date command into two commands and concatenating "at" in the midlle!! lol )

i think that's the only and best way, it also makes the code more readable.




----------------

koko5
02-16-2010, 10:16 PM
Hi, just double escape it \\t . It works fine here :)

teaorcoffee
02-16-2010, 10:45 PM
It worked for me, too koko5! Thanks

Thanks also to Len for giving gravitas to what I thought was a stupid suggestion :-)

I appreciate you both.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum