How to generate a valid postgre TIMESTAMP with PHP?

Started by Andre Lopesabout 16 years ago3 messagesgeneral
Jump to latest
#1Andre Lopes
lopes80andre@gmail.com

Hi,

I'am writing some code in PHP and I need to generate a valid postgresql
TIMESTAMP with PHP.

Any PHP programmer thar can help me on how to generate valid TIMESTAMP's
with PHP?

Sorry my bad english.

Best Regards,

#2Scott Marlowe
scott.marlowe@gmail.com
In reply to: Andre Lopes (#1)
Re: How to generate a valid postgre TIMESTAMP with PHP?

On Sun, Mar 28, 2010 at 12:27 PM, Andre Lopes <lopes80andre@gmail.com> wrote:

Hi,

I'am writing some code in PHP and I need to generate a valid postgresql
TIMESTAMP with PHP.

Any PHP programmer thar can help me on how to generate valid TIMESTAMP's
with PHP?

Just stick with something simple like:

2010-03-28 13:45:30

which will always work for an insert

#3APseudoUtopia
apseudoutopia@gmail.com
In reply to: Andre Lopes (#1)
Re: How to generate a valid postgre TIMESTAMP with PHP?

On Sun, Mar 28, 2010 at 2:27 PM, Andre Lopes <lopes80andre@gmail.com> wrote:

Hi,

I'am writing some code in PHP and I need to generate a valid postgresql
TIMESTAMP with PHP.

Any PHP programmer thar can help me on how to generate valid TIMESTAMP's
with PHP?

Sorry my bad english.

Best Regards,

In postgresql, you could use CURRENT_TIMESTAMP.

Or, in PHP, you could use date('Y-m-d H:i:s');