Ask a Question related to Macromedia Contribute General Discussion, Design and Development.
-
Larry Guest #1
Date and Time
I am calling rsync from my perl script. When it runs it creates a dir
where I want the backups to go. I need this dir to be the current
date-time.
I can get the format I want like this.
my $date = `date +%m-%d-%Y_%H-%M-%S`;
Which gives me
01-22-2004_20-04-14
But rsync does not know how to handle this string, I think when its
passed to rsync its not text as I see it on the screen. It cant make
the dir and pukes.
I have seen a bunch of stuff out there for sprintf, etc but no clear
small little script to do this.
Thanks
Larry Guest Guest
-
date without time
whenever i output my sql tables to html, the date column has the date followed by 00:00:00.00, does anyone know how to remove that? -
CFMX7.0.1 Administrator date time issue showing 13hrsbehind server time
I am running a W2k SP4 box that has been upgraded from CFMX6 to CFMX7.0.1. The CFMX7.0.1 server is showing the date on the Server Settings >... -
Convert date/time to date in SQL Server 2000 statement
Can this be done? tia -
Time/Date format and changing time to GMT
Hi All, Sorry if this is the wrong newsgroup to post into, on this topic, if so, please point me in the right direction..... Currently working... -
Date and time...
Do you want to do it from the client, or server side? translation.... Do you want to calculate the time/date based on the users computer, or to... -
Tim Johnson #2
RE: Date and Time
You should check out the localtime() function in Perl. That way you can
be sure of what you are sending to your program.
perldoc -f localtime
-----Original Message-----
From: Larry Guest [mailto:larry@opsource.net]
Sent: Thursday, January 22, 2004 5:07 PM
To: 'Perl Beginners Mailing List'
Subject: Date and Time
I can get the format I want like this.
my $date = `date +%m-%d-%Y_%H-%M-%S`;
Tim Johnson Guest
-
Owen #3
Re: Date and Time
On Thu, 22 Jan 2004 17:06:58 -0800
"Larry Guest" <larry@opsource.net> wrote:
>
> But rsync does not know how to handle this string, I think when its
> passed to rsync its not text as I see it on the screen. It cant make
> the dir and pukes.
>
> I have seen a bunch of stuff out there for sprintf, etc but no clear
> small little script to do this.
>
> Thanks
>
This will give you and answer like YYYYMMDDhhmmss for your directory name. Maybe watch line wrap
--------------------------------------------------------------
#!/usr/bin/perl
$dirname = dirname();
print "$dirname\n";
sub dirname{
my @t=localtime;
my $mon = $t[4]+1;my $yr = $t[5]+1900;
return (sprintf("%04d%02d%02d%02d%02d%02d",$t[5] +1900,$t[4]
+1,$t[3],$t[2],$t[1],$t[0]));
}
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>
--
Owen
Owen Guest
-
dave #4
Date and Time
Hello
I have one field Dt_Time in sql server 2000.
I want to insert current Date (if possible then
DD/MM/YYYY)and Time in that field..What should be the SQL
for that?
Any help would be appreciated..
Thanx
Dave
dave Guest
-
Pawel Janowski #5
Re: Date and Time
"dave" <anonymous@discussions.microsoft.com> wrote in message
news:10cf01c47b47$c67dbc80$a401280a@phx.gbl...(BOL Bookz online) CAST and CONVERT> Hello
> I have one field Dt_Time in sql server 2000.
> I want to insert current Date (if possible then
> DD/MM/YYYY)and Time in that field..What should be the SQL
> for that?
> Any help would be appreciated..
> Thanx
> Dave
in MSSQL insert directive :
set dateformat dmy
print convert(char(10),getdate(),103)
Pawel Janowski
[url]www.sunrise-tm.com[/url]
[url]www.koluszki.net[/url]
Pawel Janowski Guest
-
Bob Barrows [MVP] #6
Re: Date and Time
Pawel Janowski wrote:
Why bring up CAST and CONVERT? The 103 style will be ignored when the date> "dave" <anonymous@discussions.microsoft.com> wrote in message
> news:10cf01c47b47$c67dbc80$a401280a@phx.gbl...>>> Hello
>> I have one field Dt_Time in sql server 2000.
>> I want to insert current Date (if possible then
>> DD/MM/YYYY)and Time in that field..What should be the SQL
>> for that?
>> Any help would be appreciated..
>> Thanx
>> Dave
> (BOL Bookz online) CAST and CONVERT
> in MSSQL insert directive :
> set dateformat dmy
> print convert(char(10),getdate(),103)
>
>
> Pawel Janowski
> [url]www.sunrise-tm.com[/url]
> [url]www.koluszki.net[/url]
is stored in the table. A simple:
UPDATE tablename
SET Dt_Time = GETDATE()
WHERE ...
or
INSERT INTO tablename (Dt_Time, <list of other columns>)
VALUES (GETDATE(),<list of other values>)
will suffice.
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows [MVP] Guest
-
Paweł Janowski #7
Re: Date and Time
set dateformat dmy
this force DD/MM/YYYY
--
-------
Pawel Janowski
[url]http://www.sunrise-tm.com/os_janowski.aspx[/url]
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:um1zQ67eEHA.2560@TK2MSFTNGP09.phx.gbl...> Pawel Janowski wrote:>> > "dave" <anonymous@discussions.microsoft.com> wrote in message
> > news:10cf01c47b47$c67dbc80$a401280a@phx.gbl...> >> >> Hello
> >> I have one field Dt_Time in sql server 2000.
> >> I want to insert current Date (if possible then
> >> DD/MM/YYYY)and Time in that field..What should be the SQL
> >> for that?
> >> Any help would be appreciated..
> >> Thanx
> >> Dave
> > (BOL Bookz online) CAST and CONVERT
> > in MSSQL insert directive :
> > set dateformat dmy
> > print convert(char(10),getdate(),103)
> >
> >
> > Pawel Janowski
> > [url]www.sunrise-tm.com[/url]
> > [url]www.koluszki.net[/url]
> Why bring up CAST and CONVERT? The 103 style will be ignored when the date
> is stored in the table. A simple:
>
> UPDATE tablename
> SET Dt_Time = GETDATE()
> WHERE ...
>
> or
>
> INSERT INTO tablename (Dt_Time, <list of other columns>)
> VALUES (GETDATE(),<list of other values>)
>
> will suffice.
>
> Bob Barrows
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
Paweł Janowski Guest
-
Re: Date and Time
Why bother with an insert of current datetime when you can specify a defualt
setting inside the table itself to take care of that for you automatically
each time you insert?
"dave" <anonymous@discussions.microsoft.com> wrote in message
news:10cf01c47b47$c67dbc80$a401280a@phx.gbl...> Hello
> I have one field Dt_Time in sql server 2000.
> I want to insert current Date (if possible then
> DD/MM/YYYY)and Time in that field..What should be the SQL
> for that?
> Any help would be appreciated..
> Thanx
> Dave
Guest
-
Bob Barrows [MVP] #9
Re: Date and Time
Again, datetimes are not stored with any format. They are stored as integer
pairs. The first integer contains the number of days since the seed date.
The second contains the number of milliseconds since midnight. There is
absolutely no point to trying to store a datetime with any format. Formats
must be applied when displaying the dates retrieved from the column.
For more information, check out the BOL article, Using Date and Time Data.
Bob Barrows
Paweł Janowski wrote:--> set dateformat dmy
>
> this force DD/MM/YYYY
>
>
> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
> news:um1zQ67eEHA.2560@TK2MSFTNGP09.phx.gbl...>> Pawel Janowski wrote:>>>>> "dave" <anonymous@discussions.microsoft.com> wrote in message
>>> news:10cf01c47b47$c67dbc80$a401280a@phx.gbl...
>>>> Hello
>>>> I have one field Dt_Time in sql server 2000.
>>>> I want to insert current Date (if possible then
>>>> DD/MM/YYYY)and Time in that field..What should be the SQL
>>>> for that?
>>>> Any help would be appreciated..
>>>> Thanx
>>>> Dave
>>>
>>> (BOL Bookz online) CAST and CONVERT
>>> in MSSQL insert directive :
>>> set dateformat dmy
>>> print convert(char(10),getdate(),103)
>>>
>>>
>>> Pawel Janowski
>>> [url]www.sunrise-tm.com[/url]
>>> [url]www.koluszki.net[/url]
>> Why bring up CAST and CONVERT? The 103 style will be ignored when
>> the date is stored in the table. A simple:
>>
>> UPDATE tablename
>> SET Dt_Time = GETDATE()
>> WHERE ...
>>
>> or
>>
>> INSERT INTO tablename (Dt_Time, <list of other columns>)
>> VALUES (GETDATE(),<list of other values>)
>>
>> will suffice.
>>
>> Bob Barrows
>>
>> --
>> Microsoft MVP - ASP/ASP.NET
>> Please reply to the newsgroup. This email account is my spam trap so
>> I don't check it very often. If you must reply off-line, then remove
>> the "NO SPAM"
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows [MVP] Guest
-
Paweł Janowski #10
Re: Date and Time
in db datetime are as int, but when i want put into column date in one of
format (localize) i must put the directive (set dateformat) ...
--
-------
Pawel Janowski
[url]http://www.sunrise-tm.com/os_janowski.aspx[/url]
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:eKX8AoAfEHA.1424@tk2msftngp13.phx.gbl...integer> Again, datetimes are not stored with any format. They are stored asFormats> pairs. The first integer contains the number of days since the seed date.
> The second contains the number of milliseconds since midnight. There is
> absolutely no point to trying to store a datetime with any format.> must be applied when displaying the dates retrieved from the column.
>
> For more information, check out the BOL article, Using Date and Time Data.
>
> Bob Barrows
>
> Paweł Janowski wrote:>> > set dateformat dmy
> >
> > this force DD/MM/YYYY
> >
> >
> > "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
> > news:um1zQ67eEHA.2560@TK2MSFTNGP09.phx.gbl...> >> Pawel Janowski wrote:
> >>> "dave" <anonymous@discussions.microsoft.com> wrote in message
> >>> news:10cf01c47b47$c67dbc80$a401280a@phx.gbl...
> >>>> Hello
> >>>> I have one field Dt_Time in sql server 2000.
> >>>> I want to insert current Date (if possible then
> >>>> DD/MM/YYYY)and Time in that field..What should be the SQL
> >>>> for that?
> >>>> Any help would be appreciated..
> >>>> Thanx
> >>>> Dave
> >>>
> >>> (BOL Bookz online) CAST and CONVERT
> >>> in MSSQL insert directive :
> >>> set dateformat dmy
> >>> print convert(char(10),getdate(),103)
> >>>
> >>>
> >>> Pawel Janowski
> >>> [url]www.sunrise-tm.com[/url]
> >>> [url]www.koluszki.net[/url]
> >>
> >> Why bring up CAST and CONVERT? The 103 style will be ignored when
> >> the date is stored in the table. A simple:
> >>
> >> UPDATE tablename
> >> SET Dt_Time = GETDATE()
> >> WHERE ...
> >>
> >> or
> >>
> >> INSERT INTO tablename (Dt_Time, <list of other columns>)
> >> VALUES (GETDATE(),<list of other values>)
> >>
> >> will suffice.
> >>
> >> Bob Barrows
> >>
> >> --
> >> Microsoft MVP - ASP/ASP.NET
> >> Please reply to the newsgroup. This email account is my spam trap so
> >> I don't check it very often. If you must reply off-line, then remove
> >> the "NO SPAM"
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
Paweł Janowski Guest
-
Bob Barrows [MVP] #11
Re: Date and Time
Ah, now I understand your point, and I see now that you were responding to
the OP's desire to supply the dates in a particular format (although I think
he was really asking how to STORE the dates with that format, which, again,
is not possible). However, good programming practices include supplying
dates in a non-ambiguous format, such as the ISO YYYYMMDD format.
Bob Barrows
Paweł Janowski wrote:--> in db datetime are as int, but when i want put into column date in
> one of format (localize) i must put the directive (set dateformat) ...
>
>
> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
> news:eKX8AoAfEHA.1424@tk2msftngp13.phx.gbl...>> Again, datetimes are not stored with any format. They are stored as
>> integer pairs. The first integer contains the number of days since
>> the seed date. The second contains the number of milliseconds since
>> midnight. There is absolutely no point to trying to store a datetime
>> with any format. Formats must be applied when displaying the dates
>> retrieved from the column.
>>
>> For more information, check out the BOL article, Using Date and Time
>> Data.
>>
>> Bob Barrows
>>
>> Paweł Janowski wrote:>>>>> set dateformat dmy
>>>
>>> this force DD/MM/YYYY
>>>
>>>
>>> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
>>> news:um1zQ67eEHA.2560@TK2MSFTNGP09.phx.gbl...
>>>> Pawel Janowski wrote:
>>>>> "dave" <anonymous@discussions.microsoft.com> wrote in message
>>>>> news:10cf01c47b47$c67dbc80$a401280a@phx.gbl...
>>>>>> Hello
>>>>>> I have one field Dt_Time in sql server 2000.
>>>>>> I want to insert current Date (if possible then
>>>>>> DD/MM/YYYY)and Time in that field..What should be the SQL
>>>>>> for that?
>>>>>> Any help would be appreciated..
>>>>>> Thanx
>>>>>> Dave
>>>>>
>>>>> (BOL Bookz online) CAST and CONVERT
>>>>> in MSSQL insert directive :
>>>>> set dateformat dmy
>>>>> print convert(char(10),getdate(),103)
>>>>>
>>>>>
>>>>> Pawel Janowski
>>>>> [url]www.sunrise-tm.com[/url]
>>>>> [url]www.koluszki.net[/url]
>>>>
>>>> Why bring up CAST and CONVERT? The 103 style will be ignored when
>>>> the date is stored in the table. A simple:
>>>>
>>>> UPDATE tablename
>>>> SET Dt_Time = GETDATE()
>>>> WHERE ...
>>>>
>>>> or
>>>>
>>>> INSERT INTO tablename (Dt_Time, <list of other columns>)
>>>> VALUES (GETDATE(),<list of other values>)
>>>>
>>>> will suffice.
>>>>
>>>> Bob Barrows
>>>>
>>>> --
>>>> Microsoft MVP - ASP/ASP.NET
>>>> Please reply to the newsgroup. This email account is my spam trap
>>>> so
>>>> I don't check it very often. If you must reply off-line, then
>>>> remove the "NO SPAM"
>> --
>> Microsoft MVP - ASP/ASP.NET
>> Please reply to the newsgroup. This email account is my spam trap so
>> I don't check it very often. If you must reply off-line, then remove
>> the "NO SPAM"
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows [MVP] Guest
-
Willie Hoad #12
date and time
:confused; How do you get the date and time to change automatically on a new day boot up. I can obviously see where you out the date and time text but I can't get my website to update it on a bootup.
Willie Hoad Guest
-
tookiebunten #13
Date and Time
Hi
Is there an easy way to display the users system time and date?
Thanks
tookiebunten Guest
-
jylaxx #14
Re: Date and Time
date = new Date() ;
then format the date object with DateFormatter if necessary.
add a label to the stage and set the text property.
Is that your question ?
jylaxx Guest
-
tookiebunten #15
Re: Date and Time
Hi
Sorry for being dump but I'm new to flex and actionscript have only been using
it for about 3 weeks and haven't had a course yet. How do I use that and does
it also show the time and will it update on its own?
Thanks
tookiebunten Guest
-
jylaxx #16
Re: Date and Time
Well try first without the DateFormatter, just set the text property of the
Label to date.toString().
To refresh the value you have to use a Timer and update the date in the TIMER
event. To get the new date just recreate a new Date object.
If all is working then look at the documentationi about DateFormatter.
jylaxx Guest
-
tookiebunten #17
Re: Date and Time
I'm getting the date displayed ok but I'm struggling to get a formatter to work
can you check my code and tell me where I'm going wrong?
I'm probably doing something silly thanks
[Bindable]
private var dateTime:Date = new Date();
private function formatDisplayTime(item:Date):String
{
return timeDisplayFormatter.format(item);
}
<mx:DateFormatter id="timeDisplayFormatter" formatString="EEE, D MMM YYYY
HH:NN:SS "/>
tookiebunten Guest
-
jylaxx #18
Re: Date and Time
the wrong code is not here. What you post is correct. But I don't know where you call the formatDisplayTime method ???
jylaxx Guest
-
tookiebunten #19
Re: Date and Time
This is my full code. Be nice I'm just learning and the code might be all other
the place. Thanks for having a look.
<!--APPLICATION STARTS HERE-->
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="murdochRoomData.send(), edisonRoomData.send(),
monierRoomData.send(), bellRoomData.send()"
backgroundColor="#231F20"
backgroundGradientAlphas="1" >
<!--ACTIONSCRIPTS START HERE-->
<mx:Script>
<![CDATA[
//displays the date and time
[Bindable]
private var dateTime:Date = new Date();
private function formatDisplayTime(item:Date):String
{
return timeDisplayFormatter.format(item);
}
[Bindable]
private var text:String = "www.citybuildingglasgow.co.uk..... Repairs
Hotline 0800 595 595.....";
[Bindable]
private var speed:Number = 2;
private function initTicker():void
{
theWelcomeMessage.move( theWelcomeMessage.width, 0); //starts the text on
the right.
callLater(moveText);
}
private function moveText():void
{
var xpos:Number = theWelcomeMessage.x;
if (xpos-speed+theWelcomeMessage.width < 0 ){
xpos = theWelcomeMessage.width; //start the text on the right.
}
xpos -= speed;
theWelcomeMessage.move(xpos,0)
callLater(moveText);
}
//this script controls the videoplay back looping once the video ends.
//it also displays the video playback time in minutes and seconds.
private function formatTime(item:Date):String
{
return dateFormatter.format(item);
}
private function videoDisplay_playheadUpdate():void
{
/*if playhead time is 0, set to 100ms so the DateFormatter doesn't return and
empty string. */
var pT:Number = videoDisplay.playheadTime || 0.1;
var tT:Number = videoDisplay.totalTime;
/*convert playheadTime and totalTime from seconds to milliseconds and create
new Date objects. */
var pTimeMS:Date = new Date(pT * 1000);
var tTimeMS:Date = new Date(tT * 1000);
videoTimeLabel.text = formatTime(pTimeMS) + " / " + formatTime(tTimeMS);
}
//video controls.
private function videoDisplay_ready():void
{
videoDisplay.visible = true;
}
]]>
</mx:Script>
<!--ACTIONSCRIPTS ENDS HERE-->
<!--date formatter only shows minutes and seconds. -->
<mx:DateFormatter id="dateFormatter" formatString="NN:SS"/>
<mx:DateFormatter id="timeDisplayFormatter" formatString="EEE, D MMM YYYY
HH:NN:SS "/>
<!--calls room bookings from web server-->
<mx:HTTPService
id="murdochRoomData"
url="http://145.1.12.116/xampp/test/murdoch_room.xml"</mx:HTTPService>>
<mx:HTTPService
id="edisonRoomData"
url="http://145.1.12.116/xampp/test/edison_room.xml"</mx:HTTPService>>
<mx:HTTPService
id="monierRoomData"
url="http://145.1.12.116/xampp/test/monier_room.xml"</mx:HTTPService>>
<mx:HTTPService
id="bellRoomData"
url="http://145.1.12.116/xampp/test/bell_room.xml"</mx:HTTPService>>
<!--main container-->
<mx:Panel
id="mainAppPanel"
width="100%"
paddingBottom="10"
paddingLeft="10"
paddingRight="10"
paddingTop="10"
title="Meeting Room Information"
height="75%"
backgroundImage="@Embed(source='../assets/rev_background.jpg')"
borderColor="#231F20"
borderAlpha="0"
color="#FDFDFD"
backgroundColor="#231F20"
titleIcon="@Embed(source='../assets/rev_icon.jpg')"
dropShadowEnabled="false"
cornerRadius="0"
maxWidth="1024"
maxHeight="768"
highlightAlphas="0, 0"<!--horizantally divides the main container-->>
<mx:HDividedBox
width="100%"
height="100%"
id="mainHDivideBox">
<!--vertically divides the left side of the app-->
<mx:VDividedBox height="100%" maxWidth="340">
<!--holds the videobox-->
<mx:HBox id="videoHbox">
<!--video container-->
<mx:Panel
id="videoPanel"
title="About City Building (Glasgow) LLP"
color="#FEFEFE"
borderAlpha="0.8"
borderColor="#282626"<!--displays the flash video of the cb promo. the video will continually>
loop-->
<mx:VideoDisplay id="videoDisplay"
visible="false"
ready="videoDisplay_ready()"
playheadUpdate="videoDisplay_playheadUpdate()"
rewind="videoDisplay.play()"
source="CB.flv"
width="320"
height="240"
/>
<!-- displays the playback time of the video-->
<mx:ControlBar id="controlBar">
<mx:Label id="videoTimeLabel" textAlign="right"/>
</mx:ControlBar>
</mx:Panel>
</mx:HBox>
<!--holds the data and time panel-->
<mx:HBox id="timeDateHBox" width="100%">
<!--displays the date and time-->
<mx:Panel
id="timeDate"
width="100%"
title="Today"
borderAlpha="0.60"
borderColor="#282626"
textAlign="left">
<mx:Canvas
horizontalScrollPolicy="off"
backgroundColor="#231F20"
color="white"
width="100%"<mx:Label text="{(dateTime.toString())}" fontWeight="bold"/>>
</mx:Canvas>
</mx:Panel>
</mx:HBox>
<mx:HBox width="100%" id="welcomeMessageHBox">
<!--welcome text panel-->
<mx:Panel
id="welcomeMessagePanel"
title="Welcome to City Building (Glasgow) LLP"
width="100%"
color="#FEFEFE"
borderAlpha="0.60"
borderColor="#282626"
backgroundColor="#262828"<mx:Canvas>
creationComplete="initTicker()"
horizontalScrollPolicy="off"
backgroundColor="#231F20"
color="white"
width="100%"
fontWeight="bold">
<mx:Label
id="theWelcomeMessage"
text="{text}"
y="0"
/>
</mx:Canvas>
</mx:Panel>
</mx:HBox>
</mx:VDividedBox>
<!--divides the main panel vertically-->
<mx:VDividedBox
width="60%"
height="100%"
id="mainVDivideBox">
<!--divides the panel horizontally-->
<mx:HBox
width="100%"
height="100%"
id="topHBox">
<!--this panel contains the murdoch room info-->
<mx:Panel
id="murdochPanel"
width="50%"
height="100%"
title="The Murdoch Room"
borderColor="#7CC0F9"
color="#060606"
borderAlpha="0.8"
backgroundAlpha="0.5"<!--displays the bookings for the murdoch room-->>
<mx:DataGrid
id="murdochDataGrid"
width="100%"
dataProvider="{murdochRoomData.lastResult.murdochR oom.booking}"
height="100%"
backgroundAlpha="0.5"
/>
</mx:Panel>
<!--this panel contains the edison room info-->
<mx:Panel
id="edisonPanel"
width="50%"
height="100%"
title="The Edison Room"
borderColor="#F9F766"
color="#070707"
borderAlpha="0.8"
backgroundAlpha="0.5">
<!--displays the bookings for edison room-->
<mx:DataGrid
id="edisonDataGrid"
width="100%"
dataProvider="{edisonRoomData.lastResult.edisonRoo m.booking}"
height="100%"
backgroundAlpha="0.5"/>
</mx:Panel>
</mx:HBox>
<!--divides the panel horizontally-->
<mx:HBox
width="100%"
height="100%"
id="bottomHBox">
<!--this panel contains the monier suite info-->
<mx:Panel
id="monierPanel"
width="50%"
height="100%"
title="The Monier Room"
borderColor="#8A8787"
color="#070707"
borderAlpha="0.8"
backgroundAlpha="0.5">
<!--displays the bookings for the monier suite-->
<mx:DataGrid
id="monierDataGrid"
width="100%"
dataProvider="{monierRoomData.lastResult.monierRoo m.booking}"
height="100%"
backgroundAlpha="0.5"/>
</mx:Panel>
<!--this panel contains the bell suite info-->
<mx:Panel
id="bellPanel"
width="50%"
height="100%"
title="The Bell Room"
borderColor="#F1B106"
color="#060606"
borderAlpha="0.8"
backgroundAlpha="0.5">
<!--displays the bookings for bell suite-->
<mx:DataGrid
id="bellDataGrid"
width="100%"
dataProvider="{bellRoomData.lastResult.bellRoom.bo oking}"
height="100%"
backgroundAlpha="0.5"/>
</mx:Panel>
</mx:HBox>
</mx:VDividedBox>
</mx:HDividedBox>
<!--allows info to be added to the bottom of the main panel-->
<mx:ControlBar id="mainAppPanelControlBar">
</mx:ControlBar>
</mx:Panel>
</mx:Application>
<!--APPLICATION ENDS HERE-->
tookiebunten Guest
-
jylaxx #20
Re: Date and Time
OK !
1- You never call formatDisplayTime.
2- dateTime is defined once at the creation of the application and then it
doesn't change. Making this variable bindable is useless.
You have to use a timer as I told you :
(1) Add this code
[Bindable]
private var strNow : String ;
private var timer : Timer ;
/*private var dateTime:Date = new Date();
private function formatDisplayTime(item:Date):String
{
return timeDisplayFormatter.format(item);
}*/
private function init() : void
{
murdochRoomData.send() ;
edisonRoomData.send() ;
monierRoomData.send() ;
bellRoomData.send() ;
timer = new Timer( 1000 ) ;
timer.addEventListener( TimerEvent.TIMER, onTimer ) ;
timer.start() ;
}
private function onTimer( event : TimerEvent ) : void
{
strNow = timeDisplayFormatter.format( new Date() ) ;
}
(2) Call the init() function in the Application.creationComplete event :
creationComplete="init();"
(3) Replace the label binding : <mx:Label text="{strNow}" fontWeight="bold"/>
That's all !
jylaxx Guest



Reply With Quote

