useSystemDate ?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kpeters
Posts: 112
Joined: Wed Mar 21, 2007 9:32 pm

useSystemDate ?

Post by kpeters » Thu Jul 12, 2007 6:40 am

Mac OS X 10.4

Date & Time Settings: Dateformat set to ISO (yyyy-mm-dd)

yet:

Input in message box

Code: Select all

set the useSystemDate to true
put date()
displays 7/11/07

Anybody might know why?

TIA,
Kai

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Jul 12, 2007 11:32 am

Hi Kai,

When you execute commands through the message box, they're executed one at a time, atomically. Which means that setting a 'local' property such as the 'useSystemDate' has no influence on the next line of code that you execute.
So, there are two solutions: either use the multi-line message box ; or put everything on a single line, separated by a semicolon:

Code: Select all

set the useSystemDate to true; put the date
Hope this helped,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

kpeters
Posts: 112
Joined: Wed Mar 21, 2007 9:32 pm

Post by kpeters » Thu Jul 12, 2007 4:36 pm

Jan ~

thanks - I knew that already and should have mentioned it - it fails in the multi-line message box (and, of course, also in regular code) for me...


Any other ideas?

TIA,
Kai

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Jul 12, 2007 5:24 pm

That is odd - it works for me with Revolution 2.8.1-gm-2 on both MacOS X 10.4.10 PPC, and Windows XP.
Have you tried the oneliner approach?

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

kpeters
Posts: 112
Joined: Wed Mar 21, 2007 9:32 pm

Post by kpeters » Thu Jul 12, 2007 7:00 pm

Sure have, Jan.

I am beginning to wonder if it might be related to my turning on a locale feature (its name has escaped me) that results in a country flag being displayed in the system menu bar?

Kai

xApple
Posts: 113
Joined: Wed Nov 29, 2006 10:21 pm

Post by xApple » Thu Jul 12, 2007 7:54 pm

The country flag in the menu-bar is just the keyboard layout settings, it shouldn't affect anything else. All the international settings are made in the system preference pane of the same name.

kpeters
Posts: 112
Joined: Wed Mar 21, 2007 9:32 pm

Post by kpeters » Thu Jul 12, 2007 8:08 pm

Good to know that that's not it.

Well, what can I say:

on the "Date & Time" tab (the one showing a calendar and an analog clock) in the window labeled "Date & Time" the date format displayed is in ISO format

yet

"set the useSystemDate to true; put the date" displays "7/12/07"

Any other suggestions?
TIA,
Kai

xApple
Posts: 113
Joined: Wed Nov 29, 2006 10:21 pm

Post by xApple » Thu Jul 12, 2007 11:03 pm

The only suggestions I have is to vote for the corresponding bugs on the rev quality center. They might change something one day.
Here are the ones I found:
http://quality.runrev.com/qacenter/show_bug.cgi?id=4636
http://quality.runrev.com/qacenter/show_bug.cgi?id=3309
http://quality.runrev.com/qacenter/show_bug.cgi?id=4933
http://quality.runrev.com/qacenter/show_bug.cgi?id=2356

Reading them I also found this intresting function that might help you:

Code: Select all

function convertDateTimeToISO pDateTime
    local tTimeZone
    convert pDateTime to internet date
    put the last word of pDateTime into tTimeZOne
    convert pDateTime to dateitems
    return format("%04d-%02d-%02d %02d:%02d:%02d%s", \
      item 1 of pDateTime, item 2 of pDateTime, item 3 of pDateTime, \
      item 4 of pDateTime, item 5 of pDateTime, item 6 of pDateTime, tTimeZone)
  end convertDateTimeToISO

kpeters
Posts: 112
Joined: Wed Mar 21, 2007 9:32 pm

Post by kpeters » Fri Jul 13, 2007 2:22 am

Well - it looks as if I am out of luck here - so thanks a lot for that little function. I was just about to write one myself (plus one the other way)


Thanks,
Kai

Post Reply