strip year out of TdateValue
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
strip year out of TdateValue
Hi
I have a tdateValue like "10/9/12"
how can I strip out the year
so I get "10/9"
Thanks
I have a tdateValue like "10/9/12"
how can I strip out the year
so I get "10/9"
Thanks
Re: strip year out of TdateValue
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: strip year out of TdateValue
thanks a lot !
Re: strip year out of TdateValue
Hi Guglielmo,
That may not work. What if the month >= 10 o the day < 10?
Mark
That may not work. What if the month >= 10 o the day < 10?
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: strip year out of TdateValue
Correct ...Mark wrote:Hi Guglielmo,
That may not work. What if the month >= 10 o the day < 10?
Mark
... this is why I still format all the date field to MM/DD/YYYY with a fixed number of chars (... using the leading zeros)
Guglielmo
Re: strip year out of TdateValue
Fair enough, but then you would need to always get char 1 to 5 (not 1 to 4).Correct ...
... this is why I still format all the date field to MM/DD/YYYY with a fixed number of chars (... using the leading zeros)
See what I mean? It is just a little dicey to write code that depends on an arbitrary format. But as long as you appreciate that setting the itemDel to "/" is more robust, in that it need not examine the length of the date string, go ahead. I have done worse.
Craig Newman
Re: strip year out of TdateValue
Hi Craig,dunbarx wrote:Fair enough, but then you would need to always get char 1 to 5 (not 1 to 4).Correct ...
... this is why I still format all the date field to MM/DD/YYYY with a fixed number of chars (... using the leading zeros)
See what I mean? It is just a little dicey to write code that depends on an arbitrary format. But as long as you appreciate that setting the itemDel to "/" is more robust, in that it need not examine the length of the date string, go ahead. I have done worse.
Craig Newman
... the suggestion was only to show another possible LiveCode syntax to a new LiveCoder

Guglielmo