Get UnixTimeStamp in Java

Current UnixTimeStamp:

long currentUnixTimestamp = System.currentTimeMillis()/1000;

In  MYSQL:
 1) From date to UnixTimestamp:  SELECT UNIX_TIMESTAMP('2012-12-27 08:03:00');

2) From UnixTimeStamp to date:  SELECT FROM_UNIXTIME(1356618379);

Comments

Popular posts from this blog

Read Images from a xlsx file using Apache POI

Struts 2 : Warning :No configuration found for the specified action: 'Login.action' in namespace: '/'

How to create mail message in FRC822 format