timestamp

Why does this SELECT ... JOIN statement return no results?

I have two tables: 1. tableA is a list of records with many columns. There is a timestamp column called "created" 2. tableB is used to track users in my application that have locked a record in tableA for review. It consists of four columns: id, user_id, record_id, and another timestamp collumn. I'm trying to select up to 10 reco...

Removing rows from MySQL table where the timestamp is over one day old?

I found the exact same question here. But it isn't working for me. I've modified it a bit, manipulated it, and I can't figure it out. I'm trying to remove rows that are over a day old. Here is my code: if (isset($_POST['prune'])) { $sql = "DELETE FROM logs WHERE time < date('now', '-1 days')"; mysql_query($sql); echo 'Log...

Getting a unix timestamp as a string in C++

I'm using the function time() in order to get a timestamp in C++, but, after doing so, I need to convert it to a string. I can't use ctime, as I need the timestamp itself (in its 10 character format). Trouble is, I have no idea what form a time_t variable takes, so I don't know what I'm converting it from. cout handles it, so it must be ...

php strtotime() some help

Hi there, I am taking credit card details and I am taking the expiration date in two form field, one for the expiration month and one for the expiration year, I am wanting to store the expiration date as timestamp. Will strtotime("05/2010") create a time stamp or do I need to pass a day as well or is there an alternative? Thanks ...

setting codeigniter mysql datetime column to time() always sets it to 0

Hi guys. I'm using Codeigniter for a small project, and my model works correctly except for the dates. I have a column defined: created_at datetime not null and my model code includes in its array passed into db->insert: 'created_at' => time() This produces a datetime value of 0000-00-00 00:00:00. When I change it to: 'created_at...

Wordpress' post_time won't work with Custom PHP time difference calculator.

Hey guys, i'm using this script (http://snipplr.com/view/4912/relative-time/) to create relative times using PHP and timestamps stored in my database. I'm using the standard format for storing datetime (eg 2010-05-07 20:26:17) and it works fine with any timestamps i create. But for some reason when i try to use a timestamp stored in wor...

PHP: How do I convert a server timestamp to the user's timezone?

Hi, I'm currently storing times using the 'time()' function in the database. However, it's using the timezone of the server, and I'd like for each user to see the time according to their timezone (set in their profile). How do I do the timestamp conversion? (and I mean from timestamp to timestamp, not to readable time) Your help is ap...

relativity of the timestamp to the time zone

Hi, I wonder if, when you call something like that time(); it returns the timestamp relatively to your time zone setting or to UTC ? For example, when syncing two agents, that must be important to take care of it, doesn't it ? ...

MySQL: Ignore the timestamp attribute

I have a timestamp column in my database, and i use it for almost every field, but now, i just want to update the hit counter.. and i do not want to update the timestamp column with it. I use the timestamp field to see the last 'content' update. Not for every hit. Is it possible to let mysql stop updating the timestamp column for just o...

Converting TIMESTAMP to unix time in PHP?

Currently I store the time in my database like so: 2010-05-17 19:13:37 However, I need to compare two times, and I feel it would be easier to do if it were a unix timestamp such as 1274119041. (These two times are different) So how could I convert the timestamp to unix timestamp? Is there a simple php function for it? ...

UNIX timestamp always in GMT?

UNIX timestamp always in GMT? I tried to run php function time() and when I tried to convert the unix timestamp from the time() function, the output is not similar to the computer time. Thank You ...

C# Getting Just Date From Timestamp

If I have a timestamp in the form: yyyy-mm-dd hh:mm:ss:mmm How can I just extract the date from the timestamp? For instance, if a timestamp reads: "2010-05-18 08:36:52:236" what is the best way to just get 2010-05-18 from it. What I'm trying to do is isolate the date portion of the timestamp, define a custom time for it to create a...

PreparedStatement and setTimestamp in oracle jdbc

Hi everyone, I am using PreparedStatement with Timestamp in where clause: PreparedStatement s=c.prepareStatement("select value,utctimestamp from t where utctimestamp>=? and utctimestamp<?"); s.setTimestamp(1, new Timestamp(1273017600000L)); //2010-05-05 00:00 GMT s.setTimestamp(2, new Timestamp(1273104000000L)); //2010-05-06 00:00...

Timestamp server rfc3161 response token generation in Python

Hello! I'm trying to implement tsa server on python using twisted. Currently I'm using openssl binary to generate response, but this seems ugly to me, that's why I'm trying to figure out how to make response token with m2crypto. Thanks in advance for help! Maris. EDITED: how to achieve with m2crypto?: openssl ts -reply -section tsa_...

Time Stamp and byte array

Hi, I'm trying to insert a timestamp (hour:min:sec) into a two-byte array and i'm a little confused on how to accomplish this...any help is greatly appreciated! int Hour = CTime::GetCurrentTime().GetHour(); int Minute = CTime::GetCurrentTime().GetMinute(); int Second = CTime::GetCurrentTime().GetSecond(); BYTE arry[2]; //Need ...

Long to timestamp for historic data (pre-1900s)

I have a database of start and stop times that have previously all had fairly recent data (1960s through present day) which i've been able to store as long integers. This is very simialr to unix timestamps, only with millisecond precision, so a function like java.util.Date.getTime() would be the value of the current time. This has worke...

HQL(hibernate) timestamp range match

I need to write a query to get an object between a range of time, currently the query looks like this: Timestamp from = ... Timestamp to = ... getHibernateTemplate().find("from " + Person.class.getName() + " ml where ml.lastModifiedOn>="+from.toString()+" and m1.lastModifiedOn<=" + to.toString()); However, this doesnot work for ob...

Extract the Day / Month / Year from a Timestamp on MYSQL

Hello, I have : $date = $actualite['date']; $actualite['date'] is a TIMESTAMP and i was wondering how i can extract from this timestamp the day, then the month, then the year in 3 variables. Thank you for your help : ...

How can I convert bigint (UNIX timestamp) to datetime in SQL Server?

How can I convert bigint (UNIX timestamp) to Datetime in SQL Server? ...

Need mySQL TIMESTAMP for begining of the current week or any given date?

Hi, I need mySQL timestamp for start of current week or any given date, if week starts with monday? I'm trying something like: SELECT UNIX_TIMESTAMP(CONCAT( DATE_SUB(CURDATE(), INTERVAL WEEKDAY(DATE_SUB(CURDATE(), INTERVAL 7 DAY)) DAY), ' 00:00:00')) as start ...