×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    24

    Question UI: query and date type

    Hi all,
    I have just 2 question about query:
    Code:
    appuifw.query (u'Birthday?','date',?how can I put an initial value here?)
    this is the second question:

    Code:
    self.date1 = appuifw.query (u'Birthday?','date')
    self.txt = appuifw.Text ()
    self.txt.add (u'self.date1')
    how can I convert self.date1 to string value so I can display on Text component?
    thanks
    bye

  2. #2
    Regular Contributor
    Join Date
    Dec 2004
    Location
    Czech Republic
    Posts
    50
    ad2)

    maybe function str(...)

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    24
    it is not str . I tried but with str return a number of 5 characters that it does not the date in string format...
    thanks for the answer

  4. #4
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: UI: query and date type

    Originally posted by zell1983
    Code:
    appuifw.query (u'Birthday?','date',?how can I put an initial value here?)
    this is the second question:

    Code:
    self.date1 = appuifw.query (u'Birthday?','date')
    self.txt = appuifw.Text ()
    self.txt.add (u'self.date1')
    how can I convert self.date1 to string value so I can display on Text component?
    Time values are represented as Unix time in Python, ie. seconds since the Epoch. The initial value is also passed in this format. You can use the functions in the time module to convert that number to a human-readable form.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    24

    thanks you!

    Code:
    appuifw.query (u'Birthday?','date',[1983,7,6,0,0,0,2,187,0])
    and
    Code:
    self.date1 = appuifw.query (u'Birthday?','date')
    self.txt = appuifw.Text ()
    self.txt.add (unicode (time.strftime ("%d %b %Y",time.localtime (self.date1))))
    thanks to you all for your help
    Now it works!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×