timestamp

Difference between dates

I want to calculate the difference between two times, one of which is the current time, and the other is just in the format HH:MM, always in the future. If I just subtract $futuretime from $now, it should, of course, be a positive number. This works fine until... If $now is in the afternoon or evening and $futuretime is, say, 7AM next...

Find contacts created after a particular time-stamp

Hi, is it possible to know the time at which a contact was created. Actually I want to find all contacts created after a particular time (say 12:00 pm 29th march 2010). I thought that the contact ids were assigned in an increasing order and just noting the largest id at that point would suffice. But with Android 2.0, the internal syn...

MySQL: NOW() giving me zeros

I have a table which I want to record the timestamp of every order at every insertion time. However, I'm getting zero values for the timestamps. Here's my schema: CREATE TABLE IF NOT EXISTS orders( order_no VARCHAR(16) NOT NULL, volunteer_id VARCHAR(16) NOT NULL, date TIMESTAMP DEFAULT NOW(), ...

Return current 11-digit timestamp in Python

How can I return the current time of the local machine? This question was answered: >>import time >>time.time() >>1269888125.177495 >>int(time.time()) >>1269888125 ...

MySql difference between two timestamps in days?

How can I get the difference between two timestamps in days? Should I be using a datetime column for this? I switched my column to datetime. Simple subtraction doesn't seem to give me a result in days. mysql> SELECT NOW(), last_confirmation_attempt, NOW() - last_confirmation_attempt AS diff FROM DateClubs HAVING diff IS NOT NULL ; +-...

Why does the minus operator give different result than the TIMESTAMPDIFF() function in mysql?

Since TIMESTAMP in mysql is stored as a 32bit value representing the time interval from 1970-jan-1 0:00:00 in seconds, I assumed that using minus (-) operator on TIMESTAMP values would give the difference of these values in seconds. Actually not: +---------------------------------------------------------------------+ | TIMESTAMP("2010-0...

iPhone Development - Making sure we have a fresh location

How does this condition work? I'm unable to comprehend this. if ([newLocation.timestamp timeIntervalSince1970] < [NSDate timeIntervalSinceReferenceDate] - 60) return; Reference: More iPhone 3 Development - Tackling iPhone SDK 3 ...

NHibernate mapping with optimistic-lock="version" and dynamic-update="true" is generating invalid update statement

I have an entity "Group" with an assigned ID which is added to an aggregate in order to persist it. This causes an issue because NHibernate can't tell if it is new or existing. To remedy this issue, I changed the mapping to make the Group entity use optimistic locking on a sql timestamp version column. This caused a new issue. Group has ...

Milliseconds in DateTime.Now on .NET Compact Framework always zero?

Hi all, i want to have a time stamp for logs on a Windows Mobile project. The accuracy must be in the range a hundred milliseconds at least. However my call to DateTime.Now returns a DateTime object with the Millisecond property set to zero. Also the Ticks property is rounded accordingly. How to get better time accuracy? Remember, th...

Converting local timestamp to UTC timestamp in Java.

I have a milliseconds-since-local-epoch timestamp that I'd like to convert into a milliseconds-since-UTC-epoch timestamp. From a quick glance through the docs it looks like something like this would work: int offset = TimeZone.getDefault().getRawOffset(); long newTime = oldTime - offset; Is there a better way to do this? ...

Timestamp as part of composite primary key?

I get this error when using linq-to-sql with timestamp as part of a composite primary key: "The primary key column of type 'Timestamp' cannot be generated by the server." I'm guessing this may be due to the fact timestamp is just a row version thus perhaps it must be created after the insert? Or... ...

How to do Global (ie GMT) Outlook MailItem timestamp?

Hi, I need to download emails from a shared Outlook 2003 mailbox and store various properties in an Access database. One of the most important is the timestamp. Of all the properties of the MailItem, there are four timestamps:- . 12 CreationTime 13/04/2010 09:41:26 17 LastModificationTime 13/0...

MySQL: should I use "date" and "time" fields when I already have a timestamp field?

Hi, I have a MySQL table where there is a 'date_added' (date) field, 'time_added' (time) field and 'timestamp' (int) field. I found out afterwards that I can convert timestamp to a date or a time anyway, so so does that mean I could get rid of the other date/time fields and keep the timestamp only? Thanks in advance ...

Check file stamp using FTP to see if it is today's file.

Hi, I am using FTP (plain version) to download files from a server. The name of the file is always the same. All I can do to check to know if it is today's file is look at the timestamp manually. How can I write FTP script to check if the time stamp is having today's date? If you have come across this situation and have solved it, plea...

Facebook news feeds from a specific date and time

Hi, is there a possibility on facebook to show only the news from a specific date or time without clicking more times on the "older posts" link on the bottom of the page? For example, I found an interesting article yesterday, but I didn't have time to read it. Today I can't find it, because there are thousands of posts since then. May...

How to get the quickfix timestamp?

I've seen in quickfix doxygen documentation that it generates an utc timestamp as soon as it has received a FIX message from a socket file. Have a look in ThreadedSocketConnection::processStream(), it calls then m_pSession->next( msg, UtcTimeStamp() ); I would like to get that timestamp, because I need it to screen network and QuickF...

What time corresponds to : time()-24*60*60 ? (PHP)

Hello, just a quick question, What time corresponds to : time()-24*60*60 ? (PHP) 7 days ? is that right ? Thanks ! ...

PHP Timezone problem

I am in Albuquerque, NM. I am trying to update some stamps every time I put an entry into a database. Here is what I use. date_default_timezone_set("US/Mountain"); $stamp =mktime(); //$stamp = gmmktime(); $time = date("H:i:s",$stamp);$date = date("Y-m-d",$stamp); My local time is 12:15 PM but what I get is 18:15PM instead. If you...

Javascript function: Has half a second passed since last time you tried?

I'd like to build a function that returns false if it's been called less that half a second ago. timething.timechill=function(){ var last if (last){ if ((now.getTime()-last)>500){ return true } else{ return true } } else { ...

MySQL Group Results by day using timestamp

I need to take the following query and pull the total order counts and sum of the orders grouped by day. I'm storing everything using timestamps. SELECT COUNT(id) as order_count, SUM(price + shipping_price) as order_sum, DAY(FROM_UNIXTIME(created)) as day FROM `order` WHERE '.implode(' AND ', $where).' I need to group by ...