The Italian date format is a format for dates expressed as follows.
dd/mm/yyyy
the epoch time is defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970.
So 1428773908 shall be expressed as 11/04/2015.
Javascript provides Date object to work with dates and times.
You can construct a date object as follows:
var d = new Date(0);
and then
d.setUTCSeconds(utcSeconds);
Now you have only to read the fields of Italian date format using the get functions provided by javascript on the Date object:
d.getUTCDay()
d.getUTCMonth()
d.getUTCFullYear()
the following scripts will do the job
<script> var utcSeconds = 1428773908; console.log(ItalianFormattedDate(utcSeconds)); console.log(ItalianFormattedDateWithPadding(utcSeconds)); function ItalianFormattedDate(utcSeconds) { var d = new Date(0); d.setUTCSeconds(utcSeconds); return(d.getUTCDay()+"/"+d.getUTCMonth()+"/"+d.getUTCFullYear()) } function ItalianFormattedDateWithPadding(utcSeconds) { var d = new Date(0); d.setUTCSeconds(utcSeconds); return(paddingNumbers(d.getUTCDay(),2)+"/"+paddingNumbers(d.getUTCMonth(),2)+"/"+d.getUTCFullYear()) } function paddingNumbers(num, size) { return ('0' + num).substr(-size); } </script>
for more info about padding take a look at …..
Gg1