timestamp

Subtracting dates in PHP

I have timestamps stored in the format YYYY-MM-DD HH:MM:SS (for example 2010-06-21 20:12:56). What would the best way to check how old the timestamp is? For the moment I am mainly interested in the number of days old. ...

JAVA hibernate/webservice - Problem with Timestamp

Hi, In one of my hibernate classes I've a Timestamp variable. Now everything was alright when I used only the hibernate stuff on the server. But now I'm implementing webservice with wsgen. I get an error because Timestamp doesn't got an no-args default constructor. Message; Caused by: java.security.PrivilegedActionException: com.sun....

How to calculate an RTP Timestamp

Hi, I'm confuse with the RTP timestamp. With a PCMU file 8000hz 20ms it is 160Bytes. But, how can I calculate it for a L16Mono file with 44100Hz and also 20ms. VLC says the timestamp is 2205 and the packet size is 4410. Can anybody help me with this calculation? All regards St. ...

How can I get all objects with a timestamp greater than X from an EF repo?

I have a timestamp (rowversion) column (called t_stamp) in my tables. I use EF4 as my ORM. I see that the timestamp fields become byte[] properties on my objects. I want to use LINQ something like this: byte[] last = 0x00782342 from o in _db.Objects where o.t_stamp > last select o But that doesn't work because I can't use > on a byt...

How to search for lines in a file between two timestamps using Perl?

In Perl I am trying to read a log file and will print only the lines that have a timestamp between two specific times. The time format is hh:mm:ss and this is always the third value on each log. For example, I would be searching for lines that would fall between 12:52:33 to 12:59:33 I am new to Perl and have no idea which route to tak...

Kerberos Timestamp

Could anyone please explain how timestamps in Kerberos protect from Replay attacks? Thanks ...

Making a PHP/MySQL Timestamp look more attractive

Hello there! So basically, I'm currently selecting a Timestamp from my MySQL database. In the database, the timestamp looks like so: 2010-06-30 12:36:08 Obviously for a webapp, that's not very attractive for users to view. So, using some CodeIgniter functions, I made it look a bit nicer. <h4 class="timestamp"> <?php // Quickly c...

problem with SQL query in DB2

How can i write a query in DB2 for following thing: The difference between current timestamp and a timestamp field in dB should be >=4 hours AND <= 24 hours ...

finding time differance in DB2

How can i write a query in DB2 for following thing: The difference between current timestamp and a timestamp field in dB should be >=4 hours AND <= 24 hours Some one suggested this but its not working. select * from tableName where date <= DATEADD([hour], -4, CURRENT_TIME) and date date >= DATEADD...

Self Tracking Entities versus timestamp column in database

In an optimistic concurrency scenario fo a web-app, I am considering to give each table the timestamp column (sqlserver), comparable to a guid. Linq to entities will then generate sql update queries like WHERE id = @p0 AND timestamp = @p1 when one decorates the timestamp column with a certain attribute in Entity Framework. When the numb...

get the year out of timestamp sql

Dear Stackoverflow users and contributers, I have a problem extracting the year out of a mysql timestamp field. I managed to get it work with a datetime field using this method: SELECT id FROM TABLE WHERE YEAR(creation_date) = 2010 CREATE TABLE IF NOT EXISTS `pub_media` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parent_id` int(11) D...

Entity Framework timestamp Generate Database problem

Hi. I got a problem with EF 4.0 I creating entity with "timestamp" column. After that, I try to generate database. In SQL script column looks like 'binary(8)' instead of timestamp. How to solve it ? ...

[iPhone app] Storing a timestamp value and showing it to the UI

Hello, in my application I get, using JSON, a timestamp value like this : 1278321016000 for 2010-07-05 11:10:16.0 CEST 1278436867000 for 2010-07-06 19:21:07.0 CEST I'm currently storing this value to long type, but I wonder if it is the right way, have I to search thing with NSTimeInterval ? What would be, after storing this value,...

How to see if the date is later than 8 days?

Hi all, i have a string field (and i can't change this because the date format) on mysql database that contains a date (Like: "01-03-2010"), and i wan't to make a function to compare that date and return true if today's date is newer than 8 days, and false if the date is lower or bigger than today's date... Example: 01-03-2010 < (08-06...

How to parse ZendGData Picasa GPhotoTimestamps in PHP

So, i'm having a lot of trouble with this little piece of code. An example timestamp is this: '1278509422000'.. the problem is that it comes in as a string and I have to convert it somehow. I know about the problem with milliseconds and have tried dividing by a 1000 and much more (intval/floatval) but it just will not become a correct da...

how to group records into bucket based on the timestamp?

i have a list of entries from the logs: 15:38:52.363 1031 15:41:06.347 1259 15:41:06.597 1171 15:48:44.115 1588 15:48:44.125 1366 15:48:44.125 1132 15:53:14.525 1348 15:53:15.121 1553 15:53:15.181 1286 15:53:15.187 1293 the first one is the timestamp, the second one is the value. now i'm trying to group them up by an interval of, sa...

do you recognize a 16-digit timestamp?

Im working with Google bookmakrs and it returns 16-digit timestamp that i dont seem to be able to recognize in C# to turn into real dates, any ideas? how to turn this timestamp: 1278276905502403 to something that makes sense in C#? ...

Using SQLite3 on iPhone to get midnight (this morning) as a UNIX timestamp

Okay, I really know this has GOT to be the long way around doing this... however, what I want is relatively simple one would think. I have a database with a timestamp column. I am using iPhone SDK with SQLite3. I want to have SQLite3 get all records for today (where timestamp >= midnight this morning) .. What i have come up with (th...

Simple PHP script help, if/else/timestamps/ less than / bit-shift

I am trying to make a timestamp function that checks which displays a time if it has been less than 24 hours and a date if it has been more. If anybody knows of a prebuilt way to do this please let me know. Anyways, I've started with this simple php which is suppose to return a number less than 86400 if $temprow1 or 2 are less than 8640...

PHP time() in script/function vs $var=time();

I have a globalish variable which is $VARcurrenttime = time(); then I normally call that variable when computing anything with that timestamp (which is a lot). Someone suggested to me that using time() instead of the variable would be somewhat faster. I don't really know but could someone advise me on whether I would bother changing this...