Get current Epoch timestamp

#java:

System.currentTimeMIllis();
Note: the value is in milliseconds. Make sure to divide by 1000 if you need the value in seconds

#php:

time()

#objective-c:

NSDate now = [NSDate date];
NSTimeInterval nowEpochSeconds = [now timeIntervalSince1970];

# perl:

time

# python:

import

int(time.time())

#.NET C#

# MySQL:

SELECT unix_timestamp(now());

# Unix/Linux shell:

$ date +%s

#

Leave a comment