timestamp

TimeStamp in SQL Server 2000

I have a table named Table1 which contains an ID and TimeStamp. Table structure ID TimeStamp 1 0x0000000000047509 But when I compare the combination of these fields, it always shows false. What is the reason for this? My Query is : DECLARE @ID int DECLARE @TimeStamp timestamp SET @ID = 1 SET @TimeStamp = 0x000000000004750...

Calling a function for a period of time

I want to make a call - either a function call or doing some condition for a PERIOD of time ... typically 10 - 20 seconds. I would get some user input for the amount of time and do that ... What is the proper function to use on Linux/Unix systems? gettimeofday seems to be the way to go ... or perhaps time_t time(time_t *t) ... seems...

Pass timestamp between Powerbuilder datawindow and SQLServer insert/update stored procedure

Hi, can anyone help me out. By implementing countermeasures in solving the concurrency problem I got troubled with passing timestamps (rowversion) between Powerbuilder 7 datawindow and SQLServer 2008 (both ways) using insert and update stored procedures. The connection is serviced by ODBC, not native. Most of my attempts result in cas...

In Ruby on Rails, what's the difference between DateTime, Timestamp, Time and Date?

In my experience, getting dates/times right when programming is always fraught with danger and difficulity. Ruby and Rails have always eluded me on this one, if only due to the overwhelming number of options; I never have any idea which I should pick. When I'm using Rails and looking at ActiveRecord datatypes I can find the following ...

c# can i create a dynamic file name with streamwriter?

I was trying to make the program write to a file that was named with a time stamp. Basically, saving a timestamp to a string value, I wanted it to create the file based on that time stamp. For example "Flight Manifest 10/14/2010 1:38:29 AM.txt" Whats the right way to do this? I tried something like this: string timeStamp = DateTime.No...

Use PHP to truncate the age of a MySQL entry to the nearest unit of time

I have a table with a datetime field, and I want to pull that time stamp and use PHP to convert it to the nearest largest unit of time. For example, if the entry was made 2 minutes and 36 seconds ago, I want to echo 2 minutes in PHP. If it was 3 hours and 5 minutes ago, I want it to say 3 hours. If it was 6 days and 4 hours and 40 minute...

Getting seconds between two Oracle Timestamps

Tom Kyte suggests to use EXTRACT to get the difference: extract( day from (x-y) )*24*60*60+ extract( hour from (x-y) )*60*60+ ... This seems to be harder to read and slower than this, for example: ( CAST( x AS DATE ) - CAST( y AS DATE ) ) * 86400 So, what is the way to get the difference between two Timestamps in seconds? Thanks!...

Ruby/Rails - How to convert seconds to time?

I need to perform the following conversion: 0 -> 12.00AM 1800 -> 12.30AM 3600 -> 01.00AM ... 82800 -> 11.00PM 84600 -> 11.30PM I came up with this: (0..84600).step(1800){|n| puts "#{n.to_s} #{Time.at(n).strftime("%I:%M%p")}"} which gives me the wrong time, because Time.at(n) expects n to be number of seconds from epoch: 0 ...

How do I insert a CURRENT_TIMESTAMP into a PostGreSQL configured Drupal instalation

Hey there, I'm using drupal and a pgsql database, but after long searches I still can't figure out how to put a CURRENT_TIMESTAMP or now() into the database when inserting a row into a table. Putting now() on the default value of a column won't work, because drupal won't accept it on the database schema, so that's out of question. The c...

MySQL timestamp select date range

Not sure really where to start with this one. Can anyone help/point me in the right direction. I have a timestamp column in MySQL and I want to select a date range for example, all timestamps which are in Oct 2010. Thanks. ...

sqlite odbc getting hour min. sec.

I am using sqliteodbc and for some reason it won't get the hours, minutes, and seconds. I bind the column using this: SQLBindCol(hTimeStampNotes, 5, SQL_C_TIMESTAMP, &(noteTimeStamp.submitTime), 16, &junkLong); noteTimeStamp.submitTime is a time stamp data type: typedef struct tagTimeStampType {//TIMESTAMP_STRUCT short year; ...

What is this time format?

I am being returned this time format from an API: 1287498792000 Can anyone advise what format that is and how I would parse it in PHP? ...

Is there a possible race condition in this UPDATE statement?

I'm writing a synchronizer software which will take all changes in one DB and synchronize them to another DB. To this end I've added in my table T two columns: alter table T add LastUpdate rowversion, LastSync binary(8) not null default 0 Now I can easily select all rows that have changed since the last synchronization: select * from...

timestamp and subtract objective C

I need to find the specific time a tap happens and then the time since it has passed. I have the app counting taps, I just haven't figured out the time thing. I tried: timeStamp = [[NSDate date] timeIntervalSince1970]; but I'm new to obj c and clearly there is a syntax problem. Thanks for anyhelp. ...

What is the PHP equivalent of Javascript's Date.UTC command?

How can I say this Javascript in PHP: var ts=Date.UTC(1985,1,22); Thanks in advance. ...

MySQL storing view data over time, how to reference

Tables: videoID (vidID, vidName, vidURL) etc. viewCount (vidID, views, timestamp) The main goal of this database is to calculate the slope between the most recent view and the previous one. Lets say I automatically store the view data in the database once everyday. This means all the view data for all videos is in one big table call...

SQL Query to show number of stories created in last 24 hours?

I'm trying to create a custom query that will show the number of stories that have been posted in the last 24 hours on a Drupal 6 site. Stories are stored in the "node" table. each record has a "created" row that records the UNIX timestamp when the story was posted. Here's the query I'm trying so far: $sq = 'SELECT COUNT(*) cnt ' ...

Mysql function to generate millisecond precision timestamp as a BIGINT(13)

I am aware that mysql does not support storing timestamp columns with millisecond precision. My question: is there a mysql function I could write that will output the current time as a BIGINT(13) to millisecond precision. For example, as now() outputs a timestamp: mysql> select now(); +---------------------+ | now() | +-...

Converting UTC timestamp to ISO 8601 in Ruby

I have a timestamp that is in UTC "2010-10-25 23:48:46 UTC" I need to convert it into ISO 8601 "2010-10-29 06:09Z" The documentation is confusing as hell - what is the easiest way to do that? ...