LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-07-2012, 04:23 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
doctrine / postgres - timestamp without timezone


Hi!

I'm working on what I think is still a small project with some entities. I want to work with timestamp fields defined without timezones.

Now, doctrine complains apparently because for doctrine datetime fields won't include the milliseconds (and that's not the case).

By looking around, I see that the "parser" of datetime fields can be changed with something like this:
Code:
Doctrine\DBAL\Types\Type::overrideType('datetime', 'Doctrine\DBAL\Types\VarDateTimeType');
http://readthedocs.org/docs/doctrine...or-issues.html

Now I don't get an exception but 0s in all those fields, and that's not OK either.

What is the right approach here? Who has faced this before?
 
Old 05-07-2012, 04:32 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Oh.... I think the problem could be somewhere else (didn't see the warnings on PHP because it's a long output). Hold your breath for a while.
 
Old 05-07-2012, 04:43 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Nevermind.... it was my mistake. VarDateTimeType will create PHP Datetime objects for the values. I assumed I could thow them into date('U', aDate) to get the time since UNIX epoch.... I could just ask for aDate->getTimetsmp() instead.

Thanks anyway.
 
  


Reply

Tags
datetime, doctrine, no timezone, postgres



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Removable FAT drive timestamp trouble - timezone inconsistent RonTH Linux - General 0 05-13-2009 01:07 AM
/etc/TIMEZONE snippy Solaris / OpenSolaris 1 06-24-2008 06:35 PM
Changes in postgres without restarting postgres venki Linux - General 3 07-19-2007 01:06 AM
LXer: Google, the Associated Press, and the Fair Use Doctrine LXer Syndicated Linux News 0 09-20-2006 04:21 PM
Timezone Again rch LQ Suggestions & Feedback 5 05-19-2003 11:49 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration