Hello, am working with the date function in a php file, however the text "at" is not being rendered properly:

Initial code:

"Online reservation form submitted on " . date ("d/m/y \at\ H:i") . "\n\n" .

Rendered value:

Online reservation form submitted on 29/09/12 a30 11:52

Where instead of "at" it is becoming "a30". How to fix this?

Recommended Answers

All 6 Replies

I tried that but it instead worked as a "tab" space added to the resulting text

a and t are format characters in the date function. If you want to use them as text (literally) you must escape each of them.

date ('d/m/y \a\t H:i');

OR

date ('d/m/y').' at '.date('H:i');

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.