steveosoule
2/18/2015 - 8:39 PM

Miva - MivaScript Formatted Date Timestamp

Miva - MivaScript Formatted Date Timestamp

<mvt:comment>
	| Format Date
	| /lib/util_soap.mv
	| <MvFUNCTION NAME = "Format_SOAP_DateTime" PARAMETERS = "time_t" STANDARDOUTPUTLEVEL = "">
</mvt:comment>
<mvt:do file="g.Module_Library_Utilities" name="l.settings:group:dt_start_formatted" value="Format_SOAP_DateTime( l.settings:group:dt_start )" />


<!--

OR

-->

<mvt:assign name="g.timestamp" value="1424141086" />
<mvt:comment><!-- <mvt:assign name="g.timezone_offset" value="'-4'" /> --></mvt:comment>
<mvt:assign name="g.timezone_offset" value="'local'" />

<mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" />
<mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" />
<mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" />
<mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" />
<mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" />
<mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" />

<mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" />
&mvt:global:formatted_date;