timestamp

How to get duration in terms of minutes by subtracting a previous time stamp from the present time in PHP?

How to get duration in terms of minutes by subtracting a previous time stamp from the present time in PHP? The format of time stamp is like 2009-12-05 10:35:28 I want to calculate how many minutes have passed. How to do it? ...

How to parse time stamps with Unicode characters in Java or Perl?

I'm trying to make my code as generic as possible. I'm trying to parse install time of a product installation. I will have two files in the product, one that has time stamp I need to parse and other file tells the language of the installation. This is how I'm parsing the timestamp public class ts { public static void main (String[]...

In PHP, example of checking to see if 30 minutes have elapsed?

I have an authenticate function. The user is automatically logged out after 30 minutes. I'd like to store the time of login (timestamp?) in the authenticate function. I will then update that time each time a function requiring authentication is called. If 30 minutes have passed since the last call, it will automatically reauthenticate. I...

PHP strtotime returning wrong results

strtotime('3rd January,2010') returns 1230993600 in GMT+5:30. While according to this, unix timestamp 1230993600 is 3rd January,2009. So it's off by one year. It's happening on PHP 5.2.6 as well as 5.2.11 . ...

Whats the SQL Server TIMESTAMP equivalent in Oracle?

In the program I have, I depend on the SQL Server TIMESTAMP data type to tell me if a row's "content" has changed. What's the way to find out if a row's content has changed in Oracle (preferably without having to add a extra column for this in a table) ? ...

Why is strtotime($lastmoment) bigger than time()?

The following code echo $lastmoment."<br/>"; echo time(); echo "<br/>"; echo strtotime($lastmoment); outputs: 2009-12-15 17:40:53 1260876829 1260898853 What's wrong? $lastment is a past time stamp in MySQL, why is strtotime($lastmoment) bigger than time()? ...

Java Date cut off time information

Hi Folks, I have a Java Date object containing date and time information, e.g. 2008-01-01 13:15:00. I want to write a method that cuts off the time information so I only have the date left, e.g. 2008-01-01 00:00:00. Do you have a tip? I tried doing something like this (timestamp / (24 * 60 * 60 * 1000)) * (24 * 60 * 60 * 1000) but I ...

convert unix timestamp to a c# 18 digit using php

I am trying to to convert time() in php to a c# equivalent. I am sending a timestamp through web service for authentication and I get a fault with their timestamp displayed in C# 18 digit(633963155279823710 )and my unix time displayed as (1260718725). Does anyone have php code that will convert the unix time to the c# ticks. In another ...

JS timezone conversion

In Javascript, I have a timestamp which I'm handling like so: var origUnixTimestamp = (date * 1000); Along with this timestamp I have a UTC offset (-5, although this is variable). I'm looking to convert origUnixTimestamp to the users UTC offset, using Date's getTimezoneOffset() method. I'm just wondering how I take into account the or...

Worst case operating system clock precision?

I am not sure if this question belongs on StackOverflow but here it is. I need to generate a timestamp using C# for some data which is to be transferred from one party to another party and I need to know what is the worst case precision of the system clock in all operating system (Windows, Linux and Unix)? What I need is to figure out t...

Timestamp to internal day count

On one project, I have an internal calculation of times. The days since the launch are simply enumerated: 2009/10/19: launch day 2009/10/20: day 1 2009/10/21: day 2 etc. Now I would like to have a function which gives me the current day of the internal calculation of times. E.g. "day 129" on one day in 2010. But it is important to ha...

how to get TIMESTAMP column from Oracle DB into C++ (MFC or WIN32)?

Hi, I need to get value of column (TIMESTAMP) from oracle DB into C++. Then which dataype i should map to access database field (In MFC or WinAPI any) or what should in do to do this in proper manner. Thanks, Anuj Seharavat edit Additional info: I need to fetch data from database. I am using CRecordset class and function RFX_Date i...

Why is Oracle so slow when I pass a java.sql.Timestamp for a DATE column?

I have a table with a DATE column with time (as usual in Oracle since there isn't a TIME type). When I query that column from JDBC, I have two options: Manually convert the values with Oracle's to_date() Use a java.sql.Timestamp Both approaches work and have exclusive areas of hideousness. My problem is when I'm SELECTing data. Here ...

Why won't this simple SQL statement work?

dateposted is a MySQL TIMESTAMP column: SELECT * FROM posts WHERE dateposted > NOW() - 604800 ...*SHOULD*, if I am not mistaken, return rows where dateposted was in the last week. But it returns only posts less than roughly one day old. I was under the impression that TIMESTAMP used seconds? IE: 7 * 3600 * 24 = 604800 ...

Dealing with timestamps in R

I have multiple lists of measurements. In each list have the timestramp formated as a string ("2009-12-24 21:00:07.0") and I know that each measurement in the list is separated by 5 seconds. I want to combine all data into a huge data.frame in R. Afterwards I want to be able to easily access the time difference of two measurements so I p...

Generate random date between two dates using php

I am coding an application where i need to assign random date between two fixed timestamps how i can achieve this using php i've searched first but only found the answer for Java not php for example : $string = randomdate(1262055681,1262055681); ...

Trusted timestamping log files in Ubuntu 9.10

Hi, We have an ubuntu 9.10 server. There are some log files need to be archived and they must be timestamped to guarantee no change in time. I've found this page but couldn't found a proper solution for my current needs. Is there any command to sign log files with a trusted timestamp in Ubuntu? Regards, Burak ...

How to store time created in MySQL table?

I want to store the timestamp which a row was inserted into a MySQL table with the row, to be later compared to other times. What's the best field type for this and what's the best way to insert the row with the timestamp in PHP? ...

How to specify psycopg2 parameter for an array for timestamps (datetimes)

I'd like to run a PostgreSQL query in Python using psycopg2, which filters by a column of type timestamp without timezone. I have a long list of allowed values for the timestamp (rather than a range) and psycopg2 convenient handles arrays, so I thought that this should work: SELECT somestuff FROM mytable WHERE thetimestamp = ANY (%(time...

Oracle sqlldr timestamp format headache

Hi - I'm struggling to get sqlldr to import a csv data file into my table, specifically with the field that is a timestamp. The data in my csv file is in this format: 16-NOV-09 01.57.48.001000 PM I've tried all manner of combinations in my control file and am going around in circles. I can't find anything online - not even the Oracle...