r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[I'm new] Ask any question, and a helpful person will try to answer.

Gregg
28-Jun-2009
[3124]
Wrapping it in a func makes it less cryptic. :-)
mhinson
4-Jul-2009
[3125]
Hi. If I obtain a date from a file and it is a DATE!  what is in 
that date?  for example I know it contains date/month, but can I 
get it to return the month as a string with a leading 0 or anything 
like that?  Or is it up to me to code the formatting I need from 
integer date values? Is this documented anywhere or can I see any 
of the source some how.  Thanks.
BrianH
4-Jul-2009
[3126]
There are no built-in date formatting functions that do that. However, 
I'm sure the REBOL.org script library has one :)
mhinson
4-Jul-2009
[3127]
Hi Brian, I see some goodies there. What I am doing is too trivial 
to want to link any large blocks of code just for that so I will 
just code the bit I need I think.  I was puzzled because DATE returns 
the info with the month as  a word, but date/month returns an integer, 
so I imagined there must me more to DATE! than just a structure containing 
integers?
Ladislav
4-Jul-2009
[3128x2]
documented: do you mean like date/month date/day, etc?
http://www.rebol.com/docs/core23/rebolcore-16.html#section-3.2
mhinson
4-Jul-2009
[3130]
Hi Ladislav, yes. or any other bits of information attached to dtae 
types
Ladislav
4-Jul-2009
[3131x3]
(I found a couple of errors in the text)
seems, it was changed recently
the file http://www.rebol.com/r3/docs/datatypes/date.htmllooks like 
being affected too
Graham
4-Jul-2009
[3134x2]
>> d: now
== 5-Jul-2009/10:36:09+12:00
>> d/1
== 2009
>> d/2
== 7
>> d/3
== 5
though it's 4th of July for you guys ...
Ladislav
4-Jul-2009
[3136]
not for me anymore
mhinson
4-Jul-2009
[3137]
Thanks...  I can work with that information, but I am curious as 
to how referencing the whole date gives Jul  but there seems no option 
fot the month as a word.... not that I want it, but I am curious 
how that works.
Ladislav
4-Jul-2009
[3138]
>> d: now
== 5-Jul-2009/0:36:25+1:00
Graham
4-Jul-2009
[3139]
not applying to those guys who should be asleep!
Ladislav
4-Jul-2009
[3140]
LOL
Graham
4-Jul-2009
[3141]
which reminds me .. date functions should have a /utc refinement 
:)
mhinson
4-Jul-2009
[3142]
I write my best code in the middle of the night with no PC... shame 
it is all forgotton by the morning, or written on toilet pater.
Sunanda
4-Jul-2009
[3143]
Happy 753rd year of independence (source: wikipedia, apparently):
http://www.theonion.com/content/node/50902
Graham
4-Jul-2009
[3144x2]
mhinson .. look at the locale
753 years ???
Sunanda
4-Jul-2009
[3146]
Check the article, graham.
Graham
4-Jul-2009
[3147x2]
>> probe system/locale
make object! [
    months: [
        "January" "February" "March" "April" "May" "June"

        "July" "August" "September" "October" "November" "December"
    ]
    days: [

        "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday"
    ]
]
Gavin Menzies, the english "historian" claims the americas were "discovered" 
by a chinese fleet in 1421 ...
Ladislav
4-Jul-2009
[3149]
>> d: now
== 5-Jul-2009/0:42:01+2:00
>> pick system/locale/days d/weekday
== "Sunday"
>> pick system/locale/months d/month
== "July"
BrianH
4-Jul-2009
[3150]
Discovery means less and less every day :(
Graham
4-Jul-2009
[3151x2]
I'll only trust wikipedia when they put the "a" back in ... as wikipaedia
WTF ... did Ladislav's time zone undergo a shift  ... or is he flying 
??
mhinson
4-Jul-2009
[3153]
so does Rebol always reference the system/locale when printing a 
DATE! but only store the inteeger values?  or does it store the date 
in julian format & do more complex stuff to output even things like 
date/year
Ladislav
4-Jul-2009
[3154]
graham: the first one was from R3, the second one from R2
Graham
4-Jul-2009
[3155]
oh !
Ladislav
4-Jul-2009
[3156]
so "flying from R3 to R2"
Graham
4-Jul-2009
[3157]
In both cases .. your clock, or mine, is out by 2 mins
BrianH
4-Jul-2009
[3158]
mhinson, MOLD and FORM never reference system/locale - REBOL syntax 
is English-based.
Ladislav
4-Jul-2009
[3159]
my clock is out
Sunanda
4-Jul-2009
[3160]
Not sure we know the actual internal format.....You could run some 
timing tests to get an idea.
Another useful R2 mezzanine that may help. Mike:
   to-idate now
(to-idate not yet in R3)
Ladislav
4-Jul-2009
[3161]
is it known, that R3 does not take into account the DST?
BrianH
4-Jul-2009
[3162]
It does not notice the change, but does take into account the dst 
at start time.
Ladislav
4-Jul-2009
[3163x2]
...but it shows just +1:00 as my timezone
graham:
>> d: now
== 5-Jul-2009/0:54:14+2:00
BrianH
4-Jul-2009
[3165]
When last i checked at least. AFAIK it uses the system timezone. 
Does your system take dst into account?
Ladislav
4-Jul-2009
[3166]
R2 is able to get it
BrianH
4-Jul-2009
[3167]
R3 doesn't notice DST here (checked just now).
PeterWood
4-Jul-2009
[3168x3]
Funny it does here.
... just teasing ... Malaysia and Singapore have had  daylight savings 
al the year round since sometime in the last century.
al -> all
Graham
4-Jul-2009
[3171x2]
Equatorial countries?
Just think of what they do in Antarctica ...
BrianH
4-Jul-2009
[3173]
All antarctic bases except the Chilean ones use zone -3:00, the Chilean 
ones -4:00 to match Chile.