Re: Is the DateFormat read only?

2021-01-31 Thread Niggemann, Bernd via use-livecode
Alex Tweedly via use-livecode Sat, 07 Nov 2020 07:29:15 -0800 I tested out the TimeZone library

Re: Is the DateFormat read only?

2020-11-09 Thread Bob Sneidar via use-livecode
Your code contains a smart quote and an em dash. This works: function fUTCTime local t1,t2,t3 -- this gets the current time and puts it into UTC format, i.e -MM-DDThh:mm:ssTZD put word 5 to 6 of the internet date into t3 -- we are interested in the time and time zone put the

Re: Is the DateFormat read only?

2020-11-08 Thread Ben Rubinstein via use-livecode
This enhancement request (which from various paths has a 14 year history) is still relevant IMHO: https://quality.livecode.com/show_bug.cgi?id=4636 (It also has a handy suggestion from Mark Waddingham of a function to return "ISO date time" (as the discussions in the report shows, a

Re: Is the DateFormat read only?

2020-11-07 Thread David Bovill via use-livecode
Looks like a bug to me. So I’d say yes? I’m pretty puzzled why convert does not work with internet date. It seems a bit of a waste to make the internet date a format that you can only display and not   manipulate? Tests here indicate that converting an internet date to seconds makes no

Re: Is the DateFormat read only?

2020-11-07 Thread Alex Tweedly via use-livecode
Thank you Matthias. Those detailed instructions will come in handy for me - when/if I get that far. The problem I mentioned a couple of emails ago in this thread was in the IDE - haven\t yet got as far as doing it on the server. I tested out the TimeZone library with a couple of randomly

Re: Is the DateFormat read only?

2020-11-07 Thread matthias rebbe via use-livecode
Alex, i've posted already some info about how to use the time zone library in Livecode server in my comment to David's post "Aw: Basic question: Time Zone Library". Here it is again and a little bit more detailed. 1. copy the folder com.livecode.library.timezone from the LC extensions folder

Re: Is the DateFormat read only?

2020-11-07 Thread Alex Tweedly via use-livecode
Thanks Graham. That does indeed work - on your local system. The issue I am trying to deal with (and maybe it's related to what David is doing) is dealing with time zone issues on a LC web server. If you want to timestamp when some event happens, you can do that as a UTC timestamp using a

Re: Is the DateFormat read only?

2020-11-07 Thread Graham Samuel via use-livecode
I am as confused as anyone else as to what you are trying to do, but just in case, this little function seems to work for me to get the ’standard’ UTC date format which I have to use in my app to put time stamps into GPX files. It apparently produces the correct time zone. Doubtless it could be

Re: Is the DateFormat read only?

2020-11-06 Thread Alex Tweedly via use-livecode
I don't think it "strips" the TZ info - it simply ignores it. I think the key phrase is in the dictionary as : *Note:* The *convert* command assumes all dates / times are in local time except for 'the seconds', which is taken to be universal time. So it assume syou date is in local time

Re: Is the DateFormat read only?

2020-11-06 Thread David Bovill via use-livecode
Why does: get "Fri, 06 Nov 2020 10:57:37 +0300" convert it to internet date put it — give "Fri, 06 Nov 2020 10:57:37 +" Just seems to strip the timezone info? On 30 Oct 2020, 21:29 +, How to use LiveCode , wrote: > > ToUniversalTime ___

Re: Is the DateFormat read only?

2020-10-30 Thread J. Landman Gay via use-livecode
Good point. For our situation, hours were enough so I guess I ignored the rest (it was a long time ago and the code is old.) On 10/30/20 3:24 PM, Alex Tweedly via use-livecode wrote: But that will only work for those time zones whose variation from UTC is an exact number of hours. the

Re: Is the DateFormat read only?

2020-10-30 Thread Alex Tweedly via use-livecode
But that will only work for those time zones whose variation from UTC is an exact number of hours. the internet date has 4 digits so that it can handle hour and minute variations - you could change   subtract (char 1 to -3 of last word of the internet date) from item 4 of tTime to   put

Re: Is the DateFormat read only?

2020-10-30 Thread J. Landman Gay via use-livecode
On 10/29/20 4:33 PM, Graham Samuel via use-livecode wrote: The only souci with this format is that it gives the month in alpha, presumably according to the nationality of the OS. But it’s easy to get the numeric month in other ways. Still, it is just a little bit fiddly to create a full UTC

Re: Is the DateFormat read only?

2020-10-30 Thread Bob Sneidar via use-livecode
I have a formatDate() function (not to be confused with dateFormat) that has a few extra formats, one I call sql date for instance which is -mm-dd (and another function for time so I can produce a datetime compatible for SQL databases). I suppose it can be expanded for other formats, but

Re: Is the DateFormat read only?

2020-10-29 Thread Graham Samuel via use-livecode
Jacque Right as usual. I had forgotten about the internet date, if I ever knew. I suppose somewhere there is a little essay about all this but if so it is buried in the LC documentation. The only souci with this format is that it gives the month in alpha, presumably according to the

Re: Is the DateFormat read only?

2020-10-29 Thread Bob Sneidar via use-livecode
I believe that when you convert a pure time to dateitems it assumes the current date. The date has no time component so it assumes midnight of the current date. Bob S > On Oct 29, 2020, at 04:04 , Graham Samuel via use-livecode > wrote: > > Just FYI, I think the dictionary is wrong or

Re: Is the DateFormat read only?

2020-10-29 Thread J. Landman Gay via use-livecode
You can get the time zone, or at least the zone offset, by using "the internet date". -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On October 29, 2020 8:21:46 AM Graham Samuel via use-livecode wrote: I understand it, but the

Re: Is the DateFormat read only?

2020-10-29 Thread Graham Samuel via use-livecode
I understand it, but the Dictionary is misleading and in one case actually wrong: when it says the ’time’ form gives the seconds - it doesn’t. You need to use the ‘long time’, at least so it seems to me. I have submitted a bug report. I also thought that I could use the ToUniversalTime

Re: Is the DateFormat read only?

2020-10-29 Thread Tore Nilsen via use-livecode
If you only use a date and convert it, dateItems will assume the time to be midnight on that particular date. Tore > 29. okt. 2020 kl. 12:04 skrev Graham Samuel via use-livecode > : > > Just FYI, I think the dictionary is wrong or misleading in respect of what > the dateItems does. If you

Re: Is the DateFormat read only?

2020-10-29 Thread Graham Samuel via use-livecode
Just FYI, I think the dictionary is wrong or misleading in respect of what the dateItems does. If you script this in the LC Message Box: put the date into t1 convert t1 to dateItems put t1 You get, e.g. 2020,10,29,0,0,0,5 but if you script put the english time into t1 convert t1 to dateItems

Re: Is the DateFormat read only?

2020-10-29 Thread Graham Samuel via use-livecode
Thanks Tore - I had forgotten the existence of dateItems. That of course will do the trick. BTW I was trying to create dates in standard UTC format, and now I can. Graham > On 28 Oct 2020, at 23:18, Tore Nilsen via use-livecode > wrote: > > You can convert any given date to dateItems. Then

Re: Is the DateFormat read only?

2020-10-28 Thread Tore Nilsen via use-livecode
You can convert any given date to dateItems. Then you can use dateItems to present the date in any format you like. A date converted to dateItems will give you the following list of items: the year the month number the day of the month the hour in 24-hour time the minute the second the numeric

Re: Is the DateFormat read only?

2020-10-28 Thread John Balgenorth via use-livecode
You can always use a shell command for things like Dates and Calendars etc. Google it and you will get plenty of info. JB > On Oct 28, 2020, at 2:59 PM, Graham Samuel via use-livecode > wrote: > > A quick test seems to show that the DateFormat can’t be changed by a ‘set’ > command. > >

Is the DateFormat read only?

2020-10-28 Thread Graham Samuel via use-livecode
A quick test seems to show that the DateFormat can’t be changed by a ‘set’ command. How then can I force a date to be in a given format? I’m really thinking of the difference between US and European dates, i.e d/m/y versus m/d/y Obviously for some types of use, an LC program should be able to