timestamp

Should different servers translate unix timestamps as different dates?

Whilst working on a UI update for a client, I noticed the dates associated with all the articles were out by a day. I figured I'd screwed something up during my changes, but to be sure, threw together a little php test file that gave me some odd results. The test file is just; <?php $date = 1246053600; echo 'unix: ',$date,', converted: ...

Regular Expression to validate a timestamp

Hi, I need a regular expression to validate a timestamp of the format, using Javascript: YYYY/MM/DD HH:MI:SS I tried cooking up a few, but seems my regex skills fail to cover something or other. Please give me a reference or way to do it. P.S. : I mention regex, only as a suggestion. Im using Javascript and welcome any alternati...

Getting unix timestamp in milliseconds in PHP5 and Actionscript3

In Actionscript, the Unix timestamp in milliseconds is obtainable like this: public static function getTimeStamp():uint { var now:Date = new Date(); return now.getTime(); } The doc clearly states the following: getTime():Number Returns the number of milliseconds since midnight January 1, 1970, universa...

convert mysql timestamp to mktime

Hi, I have the following MySQL timestamp: 2009-06-23 16:21:48 How can I convert it to a format like mktime()? ...

Creating a FileName as a Timestamp in a Batch Job...

Hey Guys, We have a batch job that runs every day and copies a file to a pickup folder. I want to also take a copy of that file and drop it into an archive folder with the filename yyyy-MM-dd.log Whats the easiest way to do this in a Dos Batch Job... I'm basically looking for an equivalent of the unix command cp source.log `date +...

Set mtime based on date string in filename

Given a group of files with the following naming convention: datetime_restofname.txt an example of which would be: 200906290700_somewordorphrase.txt how could I batch change the mtime of the files to match the date and time in the filename? ...

Extracting relevant info. from Date / timestamp in adobe flex with row object

I have this code : var dp:Array = new Array(); for ( var i:int = 0; i < e.result.length; i++ ) { var row:Object = e.result[i]; dp.push( row ); } The row object consists data for different columns of a datagrid. dp.push(row) pushes the data onto the datagrid. Columns with index 3 and 4 have type of "DATE" with whole...

How to use JodaTime with java.sql.Timestamp

I Have a prepared statement INSERT INTO mst(time) VALUES (?); where time is of type Timestamp in a PostgreSQL database. I am inserting a Joda DateTime object, or I should say I am trying to. I can find no way to convert the DateTime ovject into a java.sql.Timestamp. I have read the Joda docs and see no reference to this. Thanks. ...

Get total time and time played from Flash Video component?

I've loaded a video into the FLVPlayback component and I'm looking for a way to get the total time and the time played so far and output them to two text fields so the end result would look something like "00:12/00:50". Right now I'm defining the video by the components inspector but I'm eventually hoping to define this bit by actionscr...

Where is the certificate of a TSA stored in XAdES-T?

In XAdES-T, the <EncapsulatedTimeStamp/>-element contains the TimeStampToken received from a TSA and not the entire TimeStampResp. But this TimeStampToken does not contain the certificate of the TSA (which can be found in the SignerInfo of the SignedData container). Where am I supposed to store this certificate in the XAdES-document? ...

"Touch" updated_at column in Rails 2.3.2

I have a process which iterates through a bunch of ActiveRecord models, does some processing, and saves the models again. Often though, the processing doesn't result in an changes to the attributes and so the updated_at column never changes (even though save is called). I'd prefer not to disable partial updates (in general, they're usef...

adding auto-generated date/time stamp to a mapped collection of Strings (hibernate annotations)

Hello, I am using annotations to map a basic collection of Strings to an existing entity like this: Inside the parent entity class: @org.hibernate.annotations.CollectionOfElements @JoinTable (name="GoalToAchieve_entry", joinColumns=@JoinColumn(name="goalToAchieve_id")) @org.hibernate.annotations.Sort(type = org.hibernate.annotations.S...

sort using timestamp and struts2 tag iterate

Hello, I am using strus2 tags in a jsp to iterate over a collection: <s:if test="parent.entries.size > 0"> <table border="3"> <s:iterator value="parent.entries"> <tr /> <td><s:property value="entry"></td> <td><s:property value="date" ></td> </tr> </s:iterator> </table> </s:if> I ...

Using Linq SubmitChanges without TimeStamp and StoredProcedures the same time

I am using Sql tables without rowversion or timestamp. However, I need to use Linq to update certain values in the table. Since Linq cannot know which values to update, I am using a second DataContext to retrieve the current object from database and use both the database and the actual object as Input for the Attach method like so: Publ...

displaying mysql timestamp correctly

Hey i'm trying to display a date/time from a timestamp field using: echo $date = date( "D F j", $row['date'] ); However it returns: Wed December 3 When it should return today: Monday July 13 Timestamp from the DB row is: 2009-07-13 04:16:31 Thanks. ...

set string to sqlbinary

Hi, I'm having issues with setting a string to sqlbinary or something like that. Example: The string comes from a csv file: 0x0000000001E5CFE7 It's read into string, but now I have to execute a stored procedure with the parameter timestamp, because it's an timestamp. Does anyone have an idea for me how to set this. ...

Setting subscription dates in MySQL

I'm dealing with a website where people can subscribe to certain things for virtual money. I need to put the dates at which subscriptions end in the database. My table has a field "expiration" for that, which is a DATE. When the user extends his subscription, I need to add 1 month to this date. However, if the subscription has already e...

Database design -- NULL or a max value to indicate this date value?

SO I'm working on a schedule app that uses a MySQL DB. One of the modules for this site is for managers to track tardiness, overtime, and absents. The current site is a mess. It just has the manager enter in the key data, but it doesn't bind the manager to any of the already known data (like when the employee was expected to arrive/leave...

Grouping timestamps in MySQL with PHP

I want to log certain activities in MySql with a timecode using time(). Now I'm accumulating thousands of records, I want to output the data by sets of hours/days/months etc. What would be the suggested method for grouping time codes in MySQL? Example data: 1248651289 1248651299 1248651386 1248651588 1248651647 1248651700 1248651707 ...

Using Hibernate HQL to select records where two dates are within a specified interval

I'm trying to use HQL to find records where two date fields are within 1 month of each other. Query query = session.createQuery("from com.ep.cqprojects.db.Projects " + "where active_date - kickoff_meeting_date < interval '1' month "); Unfortunately the database used apparently doesn't understand interval. How can I compare the in...