Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Text in date() function

    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:
    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 )
    Last edited by teaorcoffee; 02-16-2010 at 09:45 PM. Reason: corrected typos

  • #2
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    Quote Originally Posted by teaorcoffee View Post
    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.




    ----------------
    Leonard Whistler

  • #3
    New Coder
    Join Date
    Mar 2009
    Posts
    90
    Thanks
    5
    Thanked 14 Times in 14 Posts
    Hi, just double escape it \\t . It works fine here

  • #4
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •