timestamp

Using zero value in MySQL columns of type TIMESTAMP

I'm a little confused over the documentation of type TIMESTAMP in MySQL and whether the zero value is safe to use. The manual says: The TIMESTAMP data type has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC. ... which implies that '0000-00-00 00:00:00' is out of range and thus not valid. But, as far as I can see,...

php timestamp not logical?

Hi, I loop through an array looking at the date (as key) and if it is before the event date I use the rating value (as value). Basically I'm looking for the closest value in the array before the event date. My code: $ratingData = $player->ratingData; foreach ($ratingData as $ratingDate => $ratingValue) { list($year, $month, $day) =...

What is the Objective-c equivalent to java timestamp?

I've not found a answer to this question anywhere, but this seems like a typical problem: I have in Objective-C a "NSDate timestamp" that looks like "2010-07-14 16:30:41 +0200". The java timestamp is just a long integer (for example:"976712400000"). So, my question is: What is a Objective-c equivalent to java timestamp? Thanks in adva...

timestamp problem

Hello, i have some scripts and in the database tabel i have set the dato to int(25) and timestamp i have a create topic script and then i create a topic it insert the date and time in the timestamp tabel (dato). but somehow my comment script will not insert the time :S and its the same stuff i use :S. here is my script if(isset($_PO...

Converting string to timestamp ?

Hi, I have a xml file in which date is represented as this: "2010-07-10T14:46:00.000Z" Im parsing it and fetching it as string. I need to convert it into timestamp or date format to store in db. How do i do it? Please help. ...

Countdown Time in php

I am trying to make a countdown timer in php i have a start timestamp & end timestamp iam trying to get the output to look like this 00:05:10 can anybody lead me down the right path. Thank you ...

Why is my System.nanoTime() broken?

Myself and another developer on my time recently moved from a Core 2 Duo machine at work to a new Core 2 Quad 9505; both running Windows XP SP3 32-bit with JDK 1.6.0_18. Upon doing so, a couple of our automated unit tests for some timing/statistics/metrics aggregation code promptly started failing, due to what appear to be ridiculous va...

What is the formula for calculating a timestamp?

Just a random question but does anyone know the formula for how a timestamp is calculated? I am guessing it has to consider each month and how many days, leap years, etc. Thanks ...

Are MySQL datetime and timestamp fields better for PHP apps then Unix timestamp ints?

I was reading over an article that shows some really good information and benchmarks about how well the three different MySQL date/time storage options perform. MySQL DATETIME vs TIMESTAMP vs INT performance and benchmarking with MyISAM While reading the article you start to get the idea that using ints are just a waste and you should...

Handling MySQL datetimes and timestamps in Java

In a java application what would a good compromise in terms of extracing and inputting date information with a MySQL database using a mix of datetimes and timestamps? ...

Linq to sql and timestamp field

I've created table with timestamp field. Allow Nulls property is set to false. When I want to update entity from repository, I get null value for that field, but in databse this field is set to some value. Does anyone knows what may be the problem? I get the correct values for other fields. Thank you. edit: When I get entity from the re...

SQL: need only 1 row per particular timestamp

i have some SQL code that is inserting values from another (non sql-based) system. one of the values i get is a timestamp. i can get multiple inserts that have the same timestamp (albeit different values for other fields). my problem is that i am trying to get the first insert happening every day (based upon timestamp) since a parti...

Convert zip file timestamps to human readable format

How can the file last modification date and time, for files in a zip file, be converted to a human readable format? ...

Java: Date from unix timestamp

Hi I need to convert unix timestamp to date. I did it like this: java.util.Date time=new java.util.Date(timeStamp); timestamp value is: 1280512800 and time must be "2010/07/30 - 22:30:00" (as I get it by PHP) but it is "Thu Jan 15 23:11:56 IRST 1970" by the code above! What's the problem? ...

Timestamps with SVN (using BBedit/Texmate)

Is there a way to auto insert a time stamp into a document (html/css/ js/php/pl/txt) with every commit? ...

Surrogate Key Generation Across Multiple Tables Using Hibernate

I want to get surrogate keys for my user table(s) in MySQL. I'm sure concatinating an incrementing value + a timestamp would get me unique keys across multiple tables but how do I get the incremental value for the class's persistence table before I persist it to the database. ...

creating timestamp from columns in postgres

i have 2 rows in a column, one feeding me the julian date (number of days since Jan 1, 1970, with that day being 1), and the second column is the number of minutes past midnight of the current day (why it was done this way, i have no idea). i would like to get my sql query to create a timestamp out of these two columns. if i had access...

Insert sqlite timestamp via ContentValues

Hi all, in Android is it possible to insert a sqlite timestamp into a database using ContentValues? When I try to add it using something like ContentValues args = new ContentValues(); args.put(MY_DATE,my_date); I get an error telling me that my_date needs to be a string ...

UNIX_TIMESTAMP usage query

Hi, in my php5 code i want to use the UNIX_TIMESTAMP function to convert a datetime to a unix timestamp without using php code to convert as i believe this way is quicker but how do you then get the unix timestamp out of the rowset ie how to index into the rowset to get the integer unix timestamp out Below is a summary of the database s...

create timestamp of now as NSNumber in objective-c

Hi everyone, how can I get timestamp as NSNumber? I only need something like this: 1232885280 Thanks ...