Get current date time in the format of YYYY/MM/DD hh:mm:ss

JavaScript

const strftime=require('strftime');
console.log(strftime("%Y/%m/%d %H:%M:%S"));

PHP

<?php
date_default_timezone_set('Asia/Tokyo');
echo date('Y/m/d H:i:s');

Perl

use POSIX qw(strftime);
print(strftime("%Y/%m/%d %H:%M:%S", localtime())."\n");

Python

from datetime import datetime
print( datetime.now().strftime("%Y/%m/%d %H:%M:%S") )

Ruby

print(Time.now.strftime("%Y/%m/%d %H:%M:%S") + "\n")

Shell

DATE=`date '+%Y/%m/%d %H:%M:%S'`;
echo $DATE;