473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

compare String timestamp with a timestamp in postgres

Hello

I have string of time like this

2007/09/19 18:55:14

Also i have a timestamp field in a postgres database with timezone like this

2004-10-19 10:23:54+02

How i can convert the String above so that I can compare those two timestamps

Thanks alot
john
Sep 24 '07 #1
3 4100
eWish
971 Expert 512MB
Have you tried DateTime::Format::Pg?

--Kevin
Nov 9 '07 #2
Use this statement

Timestamp newdate = new Timestamp(new java.util.Date().getTime());
Nov 15 '07 #3
numberwhun
3,509 Expert Mod 2GB
Use this statement

Timestamp newdate = new Timestamp(new java.util.Date().getTime());
Ok, lets see here. What is wrong with this?
  1. This is a PERL forum
  2. The OP(user) has posted a question to the Perl forum regarding their PERL coding.
  3. You provided a JAVA answer!!!

Is it me or is one of these not like the other?

Sorry for the morning sarcasm, but if you are going to give an answer to a Perl question, that answer should at least be in Perl.

Regards,

Jeff
Nov 15 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: peashoe | last post by:
I have an asp page that uses a calendar.js (pop-up) file to add an exact date format in the text field (txtDDate). My problem is I need some javascript that sets an alert that does not allow them...
19
by: David zhu | last post by:
I've got different result when comparing two strings using "==" and string.Compare(). The two strings seems to have same value "1202002" in the quick watch, and both have the same length 7 which I...
2
by: Kevin Bartz | last post by:
Hi Postgressers! I really like Postgres. Thanks for all your work on it. I just have a problem with the way it's handling my flat file's timestamp columns. I have a flat file with a column with...
5
by: Prabu Subroto | last post by:
Dear my friends... I created some tables with field timestamp (datatype also timestamp). I mean, I want to have the data when each record inserted or modified in the tables. on MysQL, I just...
6
by: Scott Nixon | last post by:
New to Postgres 7.3 from 7.0. Am having some trouble with a query that worked in 7.0 but not in 7.3.....can't seem to figure out the syntax or find info about how to do this anywhere. ...
3
by: krithikas | last post by:
I have a table (which i cannot modify) where date and time fields are stored as VARCHAR. But i have to cast these fields into timestamp. My requirement is like, timestamp (select date, time where...
1
by: cssExp | last post by:
Hi, Assume i have two tables. "accounts" and "accounts_logs" "accounts" (accid, type) "accounts_log" (accid, ip, timestamp) Here i want to choose a radom 3 accids from "accounts" if...
1
by: =?Utf-8?B?RGFuaWVsIERpIFZpdGE=?= | last post by:
II want to compare how many seconds there are between files. If the files are within a 1 - 10 second range I want to copy them to their own folders. What I have so far is a couple methods that take...
0
by: zw | last post by:
Hi I have 2 log files, each with a timestamp on the first 2 fields. However, when I do a awk '/ / {print $1,$2}' logs/x.log on a log file, it is complicated by the fact that I also get other...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.