how can I get the current date?

View: New views
6 Messages — Rating Filter:   Alert me  

how can I get the current date?

by Riccardo-Maria BIANCHI-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

how can I get the current date, to be displayed on the screen?

Thanks,

   Ric.



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: how can I get the current date?

by Matthew Gregory :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

new Date()

That will return the current date as a new instance of the Date object
(this is build into the JS engine).

You can then format it using qx.util.form.Date(), the api has an example
IIRC.

HTH,
Matt


Riccardo-Maria BIANCHI wrote:

> Hi,
>
> how can I get the current date, to be displayed on the screen?
>
> Thanks,
>
>    Ric.
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: how can I get the current date?

by Fritz Zaucker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Or just using JS-builtins:

http://demo.qooxdoo.org/current/playground/#%7B%22code%22%3A%20%22var%2520d%2520%253D%2520new%2520Date%28%29%253B%250Athis.getRoot%28%29.add%28new%2520qx.ui.basic.Label%28d.toLocaleString%28%29%29%29%253B%250A%250A%22%7D

Cheers,
Fritz

On Tue, 3 Nov 2009, Matthew Gregory wrote:

> new Date()
>
> That will return the current date as a new instance of the Date object
> (this is build into the JS engine).
>
> You can then format it using qx.util.form.Date(), the api has an example
> IIRC.
>
> HTH,
> Matt
>
>
> Riccardo-Maria BIANCHI wrote:
>> Hi,
>>
>> how can I get the current date, to be displayed on the screen?
>>
>> Thanks,
>>
>>    Ric.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@...
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

--
Oetiker+Partner AG tel: +41 62 775 9903 (direct)
Fritz Zaucker                        +41 62 775 9900 (switch board)
Aarweg 15                            +41 79 675 0630 (mobile)
CH-4600 Olten                   fax: +41 62 775 9905
Schweiz                         web: www.oetiker.ch

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: how can I get the current date?

by Riccardo-Maria BIANCHI-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Matt and Fritz,

thanks a lot for your answers.

Date() works fine, but concerning the formatter I guess you meant
qx.util.format.DateFormat(), isn't it?

Unfortunately I did not find examples on the API. (I'm using trunk version)

And when I try to use it I get this error:

-----------------------------------
qx.util.format has no properties
-----------------------------------

How can I use it?

Moreover, I also saw that there is a IFormat interface. In which case am
I supposed to use that?

Thanks again,

   Ric.



Matthew Gregory wrote:

> new Date()
>
> That will return the current date as a new instance of the Date object
> (this is build into the JS engine).
>
> You can then format it using qx.util.form.Date(), the api has an example
> IIRC.
>
> HTH,
> Matt
>
>
> Riccardo-Maria BIANCHI wrote:
>  
>> Hi,
>>
>> how can I get the current date, to be displayed on the screen?
>>
>> Thanks,
>>
>>    Ric.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>>    
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@...
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>  


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: how can I get the current date?

by Stefan Volbers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Riccardo-Maria,

e.g.
var elem = new qx.ui.form.DateField();
elem.setDateFormat(new qx.util.format.DateFormat("dd.MM.yyyy"));

would emit a date in german day.month.year format.
The documentation is somewhere out there, I found it once, but didn't now...

If you want to fiddle on with DateFormats, you may wanna try this in
playground:

alert(qx.locale.Date.getDateFormat("medium", "en"));​


The qx.util.format.DateFormat class should instantiate without problems
(here it did in qx0.8.2 and 0.8.3 sdk), maybe you just forgot to
regenerate source?

HTH
Greetings
Stefan

Riccardo-Maria BIANCHI wrote:

> Hi Matt and Fritz,
>
> thanks a lot for your answers.
>
> Date() works fine, but concerning the formatter I guess you meant
> qx.util.format.DateFormat(), isn't it?
>
> Unfortunately I did not find examples on the API. (I'm using trunk version)
>
> And when I try to use it I get this error:
>
> -----------------------------------
> qx.util.format has no properties
> -----------------------------------
>
> How can I use it?
>
> Moreover, I also saw that there is a IFormat interface. In which case am
> I supposed to use that?
>
> Thanks again,
>
>    Ric.
>
>
>
> Matthew Gregory wrote:
>> new Date()
>>
>> That will return the current date as a new instance of the Date object
>> (this is build into the JS engine).
>>
>> You can then format it using qx.util.form.Date(), the api has an example
>> IIRC.
>>
>> HTH,
>> Matt
>>
>>
>> Riccardo-Maria BIANCHI wrote:
>>  
>>> Hi,
>>>
>>> how can I get the current date, to be displayed on the screen?
>>>
>>> Thanks,
>>>
>>>    Ric.
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>> is the only developer event you need to attend this year. Jumpstart your
>>> developing skills, take BlackBerry mobile applications to market and stay
>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>> http://p.sf.net/sfu/devconference
>>>    
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> qooxdoo-devel mailing list
>> qooxdoo-devel@...
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>  
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@...
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: how can I get the current date?

by Riccardo-Maria BIANCHI-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks Stephan,

I succeeded using DateField with your example.
But I would need a simple string representation of current date returned
as a String object.

So I succeded using DateFormat like this:

var dateTime = new qx.ui.basic.Label( new
qx.util.format.DateFormat().format(new Date()) );

...but I still have to figure out how to change the format here ;-)

   Ric.




Stefan Volbers wrote:

> Hi Riccardo-Maria,
>
> e.g.
> var elem = new qx.ui.form.DateField();
> elem.setDateFormat(new qx.util.format.DateFormat("dd.MM.yyyy"));
>
> would emit a date in german day.month.year format.
> The documentation is somewhere out there, I found it once, but didn't now...
>
> If you want to fiddle on with DateFormats, you may wanna try this in
> playground:
>
> alert(qx.locale.Date.getDateFormat("medium", "en"));​
>
>
> The qx.util.format.DateFormat class should instantiate without problems
> (here it did in qx0.8.2 and 0.8.3 sdk), maybe you just forgot to
> regenerate source?
>
> HTH
> Greetings
> Stefan
>
> Riccardo-Maria BIANCHI wrote:
>  
>> Hi Matt and Fritz,
>>
>> thanks a lot for your answers.
>>
>> Date() works fine, but concerning the formatter I guess you meant
>> qx.util.format.DateFormat(), isn't it?
>>
>> Unfortunately I did not find examples on the API. (I'm using trunk version)
>>
>> And when I try to use it I get this error:
>>
>> -----------------------------------
>> qx.util.format has no properties
>> -----------------------------------
>>
>> How can I use it?
>>
>> Moreover, I also saw that there is a IFormat interface. In which case am
>> I supposed to use that?
>>
>> Thanks again,
>>
>>    Ric.
>>
>>
>>
>> Matthew Gregory wrote:
>>    
>>> new Date()
>>>
>>> That will return the current date as a new instance of the Date object
>>> (this is build into the JS engine).
>>>
>>> You can then format it using qx.util.form.Date(), the api has an example
>>> IIRC.
>>>
>>> HTH,
>>> Matt
>>>
>>>
>>> Riccardo-Maria BIANCHI wrote:
>>>  
>>>      
>>>> Hi,
>>>>
>>>> how can I get the current date, to be displayed on the screen?
>>>>
>>>> Thanks,
>>>>
>>>>    Ric.
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>>> is the only developer event you need to attend this year. Jumpstart your
>>>> developing skills, take BlackBerry mobile applications to market and stay
>>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>>> http://p.sf.net/sfu/devconference
>>>>    
>>>>        
>>> ------------------------------------------------------------------------------
>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>> is the only developer event you need to attend this year. Jumpstart your
>>> developing skills, take BlackBerry mobile applications to market and stay
>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>> http://p.sf.net/sfu/devconference
>>> _______________________________________________
>>> qooxdoo-devel mailing list
>>> qooxdoo-devel@...
>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>
>>>  
>>>      
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> qooxdoo-devel mailing list
>> qooxdoo-devel@...
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>    
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@...
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>  


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel