timestamp

Automatically selecting dates from databases as Zend_Date objects

From what I understand, the best way to deal with dates in the Zend Framework is to select them as a Unix timestamp from the database. Quick Creation of Dates from Database Date Values // SELECT UNIX_TIMESTAMP(my_datetime_column) FROM my_table $date = new Zend_Date($unixtimestamp, Zend_Date::TIMESTAMP); I think it's a pain that there...

How to validate if a signed jar contains a timestamp?

After a jar is signed and the -tsa option was used, how can I validate that the time stamp was included? I tried: jarsigner -verify -verbose -certs myApp.jar But the output does not specify anything about the time stamp. I'm asking because even if I have a typo in the -tsa URL path, the jarsigner succeeds. This is the GlobalSign TSA U...

How do I plot vectors of different length on the same axes in MATLAB?

I am running into trouble trying to compare and plot two files of different length. In MATLAB I do not know how to plot two vectors of different length in the same x-axis. As one file has some data missing, I want to create a row and put blank space for that corresponding time stamp. Here are samples of data files: file 1: date time T...

Timestamp comparison in MySQL and PHP ( UTC, +0000, Timezones )

I'm trying to determine whether a string that represents the date and time, given in a JSON Twitter feed is within a range of timestamp columns in MySQL. Here's the example string: 'Sat, 31 Oct 2009 23:48:37 +0000', The +0000 according to the API ( created_at ) indicates it is indeed UTC. Now, I'm using strtotime and date just to con...

How much faster is timestamp than datetime column in MySQL?

This consists of two questions: Is MySQL's timestamp field really faster than datetime field in "order by" query? If the answer to above question is yes, how much faster it could be? Supposed in a table of 100 million rows and frequently sort a bunch of 100-200k rows based on timestamp field inside MySQL, will the sort time improvement...

How can I copy a file in Perl and maintain its timestamp?

I am using the File::Copy module to copy a file in Perl: #! /usr/bin/perl -w use File::Copy; copy("somefile.log", "copiedfile.log"); I would like to preserve timestamps (particularly the modification time), but this doesn't appear to be an option. Is there a straightforward way to achieve this without resorting to making a system ...

Migrating Oracle DATE columns to TIMESTAMP with timezone

Bakground: I've got a legacy app I'm working on that uses DATE types for most time storage in the database. I'd like to try update some of these tables so that they can utilize time zones since this is causing problems with users in different areas from where the db is(see A below). This is for Oracle 10g. Quetions: 1) Can I migrate ...

How to get PHP time tomorrow 6pm CST?

I need get a timestamp in PHP for the next day 6pm CST $tomorrow = mktime(18, 0, 0, date("m"), date("d")+1, date("y")); echo "Tomorrow is ".date("Y-m-d H:m:s ", $tomorrow); I was unable to set the minutes part for the above code, it is always returning 11 in the minutes part. Tomorrow is 2009-11-06 18:11:00 ...

File create datetime getting duplicated for different files and times

I have written a service that monitors a file drop location for files from a scanner. The scanner drops all files with the exact same file name (eg. Test.tif) unless that file already exists and then it appends on a timestamp on the end (eg. Test_0809200915301900.tif). So when I process these files I attach a 'tag' to the db entry to r...

Which is the best way to check if timestamp/datetime belongs to a specified date

Sometimes I have a datetime or timestamp columns in the database and, for example, I need to select all records with timestamp updated today. I usually do it like this: SELECT * FROM mytable WHERE CAST(TS AS DATE) = CURDATE(); SELECT * FROM mytable WHERE CAST(TS AS DATE) = '2009-11-01'; Also, it's possible to use DATE() function ...

Select ISO 8601 Timestamp from MySQL Database

Hello, I am currently using PHP/MySQL and the jQuery timeago plugin. Basically, I need to pull my timestamp from the database and convert it to ISO 8601 format. Like this 2008-07-17T09:24:17Z Currently, my timestamps are in the database in this format: 0000-00-00 00:00:00 I have tried using timeago with my currently formatted time...

PHP/MySQL Timezone Clarification

Hello all, I'm currently having an issue wrapping my brain around the notion of converting my MySQL time to a specific timezone, depending on the user's settings. All of my MySQL times are stored in UTC time, in the following format: 2009-11-08 17:06:40 Once I query the time, I'm not quite sure how to convert it to the appropriate...

Wordpress the_time formatting

Pretty simple question here, hoping for a simple answer. I want to display my wordpress time output as DD.MM.YY So today it would be 10.11.09 I couldn't find anything in the wordpress codex, I supposed its a little php? ...

Mysql - selecting year from a unix timestamp

I am using this: SELECT FROM_UNIXTIME(my_unix_timestamp_column, '%Y') AS year FROM table_name WHERE year = 2009; but it gives me an error: Unknown column 'year' in 'where clause'SELECT FROM_UNIXTIME(my_unix_timestamp_column, '%Y') AS year FROM table_name WHERE year = 2009 Both "my_unix_timestamp_column" and "table_name" are correct...

Current time in microseconds in java

On a unix system, is there a way to get a timestamp with microsecond level accuracy in java? Something like C's gettimeofday function. ...

Oracle cast(timestamp as date)

I see incosistency in Oracle. The inconsistensy is between the way INSERT timestamp data_type value into DATE data_type column works compared to the way CAST(timestamp as DATE) works. INSERT appears to simply cut off the milliseconds out of the timestamp value while CAST rounds them up to the closest second. Example: 1)TEMP TABLE crea...

Prevent Ant to perform a task if a file is older than an other file

Hi all, how can I prevent Ant to process a task if a source file is older than the current target. For example, I created a javacc file MyParser.jj and there is no need for javacc to re-generate the file MyParser.java as long as the MyParser.jj is older than MyParser.java. Thanks ...

Time stamp parsing from the beginning of a string in C#

Hi all, I am working on re-writing an existing Java software solution in .NET. At one point, the Java solution reads a time stamp at the beginning of a string, simply like this: SimpleDateFormat dateFormat = new SimpleDateFormat(timeFormat); dateFormat.setLenient(false); try { timeStamp = dateFormat.parse(line); } catch (ParseExce...

how to get a UNIVERSAL windows batch file timestamp

Hello, I'm having trouble generating a timestamp in a windows batch file because I get diferent date formats on different windows versions. My machine: >echo %date% >Tue 11/17/2009 Friends machine: >echo %date% >11/17/2009 I guess there has to be some way of getting the date (11/17/2009) from both strings using for /f, I've been t...

How do I account for missing data when creating an Excel file in MATLAB?

I had posted a similar question related to plotting data, and now I'd like to know how to handle missing data when outputting data to an Excel file using the XLSWRITE function. I have two sets of data of different length (described in the question I link to above). I am trying to replace the smaller file with zeroes for the times when t...