flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Mclean <jus...@classsoftware.com>
Subject Re: Timezone support
Date Sun, 28 Apr 2013 23:21:57 GMT
Hi,

Here's some sample code to try it out:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx"
			   initialize="init()">
	
	<fx:Script>
		<![CDATA[
			import mx.formatters.DateFormatter;
			
			protected function init():void
			{	
				var dateStr:String = df1.format(new Date());
				trace(dateStr);
				dateStr = df2.format(new Date());
				trace(dateStr);
			}
		]]>
	</fx:Script>
	
	<fx:Declarations>
		<mx:DateFormatter id="df1" formatString="DD-MMM-YYYY JJ:NN O" />
		<mx:DateFormatter id="df2" formatString="DD-MMM-YYYY JJ:NN OO" />
	</fx:Declarations>	
</s:Application>

Thanks,
Justin

Mime
View raw message