LinuxQuestions.org
Visit Jeremy's Blog.
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, 05:23 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
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, 05:32 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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, 05:43 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 02:07 AM
/etc/TIMEZONE snippy Solaris / OpenSolaris 1 06-24-2008 07:35 PM
Changes in postgres without restarting postgres venki Linux - General 3 07-19-2007 02:06 AM
LXer: Google, the Associated Press, and the Fair Use Doctrine LXer Syndicated Linux News 0 09-20-2006 05:21 PM
Timezone Again rch LQ Suggestions & Feedback 5 05-20-2003 12:49 AM


All times are GMT -5. The time now is 03:53 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration