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

#

Loop through dictionary/map/array

#PHP
foreach($map as $k => $v){
echo “key: {$k}, value:{$v}”;
}

#objective-c
for(id key in myDict){
NSLog(@”key:%@, value:%@”, key, [myDict objectForKey:key]);
}

#python
for key in myDict.iterkeys():
print (“key:{0}, value:{0}”.format(key, myDict[key])

#java
for (String key : map.keySet()) {
System.out.println(“key: ” + key + “, value:” + map.get(key));
}