{VERSION 3 0 "IBM INTEL NT" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Helvetica" 1 12 0 0 128 1 2 1 2 0 1 2 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Output" 2 20 "Helvetica" 0 0 0 0 0 1 2 2 2 0 0 2 0 0 0 }{CSTYLE "Help Heading" -1 26 "Helvetica" 1 14 0 128 128 1 2 1 2 0 0 2 0 0 0 }{CSTYLE "" -1 256 "" 1 12 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" 26 257 "" 1 14 0 128 128 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "Courier" 1 10 0 0 0 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 437 "" 1 12 0 0 0 0 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Helvetica" 1 12 128 0 0 1 2 1 2 0 0 2 0 0 0 } 0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 6 6 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "List Item" 0 14 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 3 3 0 0 0 0 0 0 14 5 }{PSTYLE "Bullet Item" 0 15 1 {CSTYLE "" -1 -1 "Helve tica" 1 12 0 0 0 0 0 1 0 0 0 0 0 0 0 }0 0 0 -1 3 3 0 0 0 0 0 0 15 2 } {PSTYLE "PRE" -1 256 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 0 1 0 1 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "OL" -1 257 1 {CSTYLE "" -1 -1 "Helvetica" 1 12 128 0 0 1 0 1 0 0 0 0 0 0 0 }0 0 0 0 4 4 3 10 0 0 2 0 -1 0 }{PSTYLE "R3 Font 0" -1 258 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 128 1 2 2 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 2" -1 259 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 0 1 2 2 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "" 3 260 1 {CSTYLE "" -1 -1 "" 1 12 0 128 128 1 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 264 1 {CSTYLE "" -1 -1 "" 0 1 0 128 128 1 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 265 1 {CSTYLE "" -1 -1 "" 0 1 0 128 128 1 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 14 267 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 268 1 {CSTYLE "" -1 -1 "" 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {SECT 1 {PARA 268 "" 0 "" {TEXT -1 0 "" }{TEXT 257 9 "Function :" }{TEXT 256 42 " ctime 1.05- returns current time and date" }}{PARA 264 "" 0 "" {TEXT 26 17 "Calling Sequence:" }}{PARA 0 "" 0 "" {TEXT -1 31 " ctime();\n ctime(timezone);" }}{PARA 265 "" 0 "" {TEXT 26 11 "Parameters:" }}{PARA 0 "" 0 "" {TEXT -1 53 " timezone - the name of a time zone in backquotes\n\n" }{TEXT 437 322 "For bug reports, pl ease send the version number of ctime and a description of the bug alo ng with\nthe return of \n\n> interface('version');\n\nyour operating s ystem, Maple version, and some values of \n\n> iolib(25);\n\nalong wit h the corresponding system time/date to\n\nAlexander Walz\nafw@pool.in formatik.rwth-aachen.de\n\nThank you " }{TEXT -1 1 " " }}}{SECT 1 {PARA 260 "" 0 "" {TEXT 26 12 "Description:" }}{PARA 15 "" 0 "" {TEXT -1 114 "ctime returns the current date and time as a list of nonnegati ve integers. The format of the output is as follows:" }}{PARA 267 "" 0 "" {TEXT -1 40 "[year, month, day, hour, minute, second]" }}{PARA 15 "" 0 "" {TEXT -1 99 "In the first form, the result is dependent on \+ the numeric value of the gloabl environment variable " }{TEXT 258 21 " _utilsCtimeDifference" }{TEXT -1 2 ". " }}{PARA 14 "" 0 "" {TEXT -1 131 "1) If this variable is unassigned, then ctime returns Greenwich M ean Time. If it is summer time, then ctime returns GMT + one hour." }} {PARA 14 "" 0 "" {TEXT -1 6 "2) If " }{TEXT 259 21 "_utilsCtimeDiffere nce" }{TEXT -1 50 " is set to 0, then ctime works as described in 1). " }}{PARA 14 "" 0 "" {TEXT -1 6 "3) If " }{TEXT 260 21 "_utilsCtimeDif ference" }{TEXT -1 355 " is set to n, with type(n, posint) then ctime \+ adds n seconds to GMT, if type(n, negint) then ctime substracts abs(n) seconds from GMT, with one hour added in both cases if it is summer t ime. Preferrably, n is a multiple of 3600 (= one hour).\nSummer time i s defined as follows: It begins on the first Sunday in April and ends \+ on the last Sunday in October." }}{PARA 15 "" 0 "" {TEXT -1 223 "In th e second form, by specifying the abbreviation of a time zone in backqu otes, the current local date and time are returned without any adjustm ent in summer time. The following abbreviations (first column) are acc epted:\n\n" }{TEXT 261 2111 "`GMT` Greenwich Mean Time \+ 0\n`UTC` Universal Coordinated Time 0\n`WET` We stern European Time 0\n`WAT` West African Time \+ -01\n`AT` Azores Time -02\n`AST` \+ Atlantic Standard Time -04\n`EST` Eastern Standard Time -05\n`CST` Central Standard Time -06 \n`MST` Mountain Standard Time -07\n`PST` Pacific \+ Standard Time -08\n`YST` Yukon Standard Time \+ -09\n`AHST` Alaska-Hawaii Standard Time -10\n`CAT` C entral Alaska Time -10\n`HST` Hawaii Standard Time \+ -10\n`NT` Nome Time -11\n`IDLW ` International Date Line West -12\n`CET` Central Europea n Time +01\n`FWT` French Winter Time +01 \n`MET` Middle European Time +01\n`MEWT` Middle E uropean Winter Time +01\n`SWT` Swedish Winter Time \+ +01\n`EET` Eastern European Time +02\n`BT` B aghdad Time +03\n`WAST` West Australien Time \+ +07\n`CCT` China Coast Time +08\n`JST` Japan Standard Time +09\n`EAST` East Australian Standard Time +10\n`GST` Guam Standard Time +10 \n`IDLE` International Date Line East +12\n`NZST` New Zeal and Standard Time +12\n`BST` British Summer Time \+ +01\n`ADT` Atlantic Daylight Time -03\n`EDT` E astern Daylight Time -04\n`CDT` Central Daylight Time \+ -05\n`MDT` Mountain Daylight Time -06\n`PDT` Pacific Daylight Time -07\n`YDT` Yukon Daylight \+ Time -08\n`HDT` Hawaii Daylight Time -09 \n`MEST` Middle European Summer Time +02\n`SST` Swedish \+ Summer Time +02\n`FST` French Summer Time \+ +02\n`WADT` West Australian Daylight Time +08\n`EADT` E ast Australian Daylight Time +11\n`NZDT` New Zealand Daylight T ime +13" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 387 "# ctime \+ 1.05 - October 17, 1998, afw@pool.informatik.rwth-aachen.de\n# current date and time depending on the return of iolib(25) which determines t he number of\n# seconds passed since a specific date (in Windows and U NIX: January 01, 1970) or\n# till a specific date (Apple: 2/6/2040; 6: 28:15); iolib(25) queries the hardware clock of\n# the computer system not that of the operating system" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "restart: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "# assign base year; for UNIX and Windows: 1970" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "_utilsCtimeBaseYear := 1970: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 363 "# number of seconds to be added (o r subtracted) to (from) iolib(25); it has been reported that\n# the ha rdware clock of some computers internally use Greenwich Medium Time, s o in those\n# cases please adjust _utilsCtimeDifference according to y our time zone, i.e. assign a positive \n# or negative number of second s (time difference), e.g. CET: + 3600, PDT: -8*3600." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "_utilsCtimeDifference := 3600: # adjust t ime to CET" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5879 "ctime := pr oc()\n global _utilsCtimeBaseYear, _utilsCtimeDifference;\n local \+ feb, nleapyears, seconds, minutes, hours, days, years, curyear, \n \+ restyears, months, quomonthdays, accmonths, n, i, curmonth, restdays , quodaysyear, \n curday, resthours, curhour, quohoursaday, restm inutes, curminute, quominutesanhour,\n restseconds, cursecond, qu osecondsaminute, summertime, isApple, timezones,\n ifversion, tim eDifference;\n options `Copyright by Alexander F. Walz, 1998, optimi zed by Douglas W. Harder (WMI)`;\n\n feb := y -> \n `if`(type(y /4, integer) and not(type(y/100, integer) or type(y/400, integer)), 29 , 28):\n\n nleapyears := proc(n1::integer, n2::integer)\n nops( [seq(n, n=ceil((n1+3)/4) .. floor((n2+3)/4))])\n end:\n \n timez ones := table([\n `GMT`=0, `UTC`=0, `WET`=0, `WAT`=-01, `AT`=-02, `AST`=-04, `EST`=-05, `CST`=-06,\n `MST`=-07, `PST`=-08, `YST`= -09, `AHST`=-10, `CAT`=-10, `HST`=-10, `NT`=-11,\n `IDLW`=-12, ` CET`=+01, `FWT`=+01, `MET`=+01, `MEWT`=+01, `SWT`=+01, `EET`=+02,\n \+ `BT`=+03, `WAST`=+07, `CCT`=+08, `JST`=+09, `EAST`=+10, `GST`=+10, `IDLE`=+12,\n `NZST`=+12, `BST`=+01, `ADT`=-03, `EDT`=-04, `CDT` =-05, `MDT`=-06, `PDT`=-07,\n `YDT`=-08, `HDT`=-09, `MEST`=+02, \+ `SST`=+02, `FST`=+02, `WADT`=+08, `EADT`=+11,\n `NZDT`=+13]):\n\n summertime := table([\n 1970 = [5, 25], 1971 = [4, 31], 1972 = [2, 29], 1973 = [1, 28], 1974 = [7, 27], 1975 = [6, 26], \n 1976 = [4, 31], 1977 = [3, 30], 1978 = [2, 29], 1979 = [1, 28], 1980 = [6, 26], 1981 = [5, 25], \n 1982 = [4, 31], 1983 = [3, 30], 1984 = [ 1, 28], 1985 = [7, 27], 1986 = [6, 26], 1987 = [5, 25], \n 1988 = [3, 30], 1989 = [2, 29], 1990 = [1, 28], 1991 = [7, 27], 1992 = [5, 2 5], 1993 = [4, 31], \n 1994 = [3, 30], 1995 = [2, 29], 1996 = [7, 27], 1997 = [6, 26], 1998 = [5, 25], 1999 = [4, 31], \n 2000 = [ 2, 29], 2001 = [1, 28], 2002 = [7, 27], 2003 = [6, 26], 2004 = [4, 31] , 2005 = [3, 30], \n 2006 = [2, 29], 2007 = [1, 28], 2008 = [6, 2 6], 2009 = [5, 25], 2010 = [4, 31], 2011 = [3, 30], \n 2012 = [1, 28], 2013 = [7, 27], 2014 = [6, 26], 2015 = [5, 25], 2016 = [3, 30], \+ 2017 = [2, 29], \n 2018 = [1, 28], 2019 = [7, 27], 2020 = [5, 25] , 2021 = [4, 31], 2022 = [3, 30], 2023 = [2, 29], \n 2024 = [7, 2 7], 2025 = [6, 26], 2026 = [5, 25], 2027 = [4, 31], 2028 = [2, 29], 20 29 = [1, 28], \n 2030 = [7, 27], 2031 = [6, 26], 2032 = [4, 31], \+ 2033 = [3, 30], 2034 = [2, 29], 2035 = [1, 28], \n 2036 = [6, 26] , 2037 = [5, 25], 2038 = [4, 31], 2039 = [3, 30], 2040 = [1, 28], 2041 = [7, 27], \n 2042 = [6, 26], 2043 = [5, 25], 2044 = [3, 30], 20 45 = [2, 29], 2046 = [1, 28], 2047 = [7, 27], \n 2048 = [5, 25], \+ 2049 = [4, 31], 2050 = [3, 30], 2051 = [2, 29], 2052 = [7, 27], 2053 = [6, 26], \n 2054 = [5, 25], 2055 = [4, 31], 2056 = [2, 29], 2057 = [1, 28], 2058 = [7, 27], 2059 = [6, 26], \n 2060 = [4, 31], 20 61 = [3, 30], 2062 = [2, 29], 2063 = [1, 28], 2064 = [6, 26], 2065 = [ 5, 25], \n 2066 = [4, 31], 2067 = [3, 30], 2068 = [1, 28], 2069 = [7, 27], 2070 = [6, 26], 2071 = [5, 25], \n 2072 = [3, 30], 2073 = [2, 29], 2074 = [1, 28], 2075 = [7, 27], 2076 = [5, 25], 2077 = [4, 31], \n 2078 = [3, 30], 2079 = [2, 29], 2080 = [7, 27], 2081 = [ 6, 26], 2082 = [5, 25], 2083 = [4, 31], \n 2084 = [2, 29], 2085 = [1, 28], 2086 = [7, 27], 2087 = [6, 26], 2088 = [4, 31], 2089 = [3, 3 0], \n 2090 = [2, 29], 2091 = [1, 28], 2092 = [6, 26], 2093 = [5, 25], 2094 = [4, 31], 2095 = [3, 30], \n 2096 = [1, 28], 2097 = [ 7, 27], 2098 = [6, 26], 2099 = [5, 25], 2100 = [4, 31]]);\n # sto res first Sunday in April as first entry, last Sunday in October in se cond entry\n\n ifversion := interface('version');\n isApple := eva lb(SearchText(`APPLE`, ifversion) > 0);\n if not(assigned(_utilsCtim eBaseYear)) then\n _utilsCtimeBaseYear := 1970\n fi;\n if nar gs = 1 and assigned(timezones[args[1]]) then \n timeDifference := timezones[args[1]]*3600\n elif not(assigned(_utilsCtimeDifference)) then \n timeDifference := 0\n else\n timeDifference := _u tilsCtimeDifference\n fi; \n if nargs = 1 and args[1] = 'SummerTim e' then\n seconds := `if`(isApple, \n 2212118897 + iolib( 25) + 60*60 + timeDifference,\n iolib(25) + 60*60 + timeDiffer ence);\n # 2212118897 = number of seconds from Jan 01/1970, 0:00: 00 through 2/6/2040; 6:28:15\n # if summertime then add 1 hour\n \+ else\n seconds := `if`(isApple,\n 2212118897 + iolib(25 ) + timeDifference,\n iolib(25) + timeDifference);\n fi; # ( seconds since 01/01/timeBaseYear) + timeDifference\n minutes := seco nds/60;\n hours := minutes/60;\n days := hours/24;\n years := da ys/365;\n curyear := trunc(years) + _utilsCtimeBaseYear; # currentye ar\n years := (days - nleapyears(_utilsCtimeBaseYear, curyear))/365; \n curyear := trunc(years)+_utilsCtimeBaseYear;\n restyears := fra c(years); \n months := [31, feb(curyear), 31, 30, 31, 30, 31, 31, 30 , 31, 30, 31];\n quomonthdays := map(x -> x/365, months);\n accmon ths := [0, seq(add(quomonthdays[i], i=1 .. n), n=1 .. 12)];\n curmon th := 0:\n for n in accmonths while restyears >= n do\n curmont h := curmonth + 1\n od;\n restdays := restyears - accmonths[curmon th];\n curday := trunc(restdays/(1/(365))) + 1;\n resthours := res tdays - (curday-1)/365;\n curhour := trunc(resthours/(1/(365*24))); \n restminutes := resthours - (curhour)/(365*24);\n curminute := t runc(restminutes/(1/(365*24*60)));\n restseconds := restminutes - cu rminute/(365*24*60);\n cursecond := restseconds/(1/(365*24*60*60)); \n if nargs= 0 and (curmonth > 4 and curmonth < 10 or\n curmont h = 4 and curday >= op(1, summertime[curyear]) or\n curmonth = 10 and curday <= op(2, summertime[curyear])) then\n RETURN(procname ('SummerTime'))\n fi;\n [curyear, curmonth, curday, curhour, curmi nute, cursecond]\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "ct ime();" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7(\"%)*>\"#5\"#<\"#=\"\")\"# C" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 137 "months := [`January`, `February`, `March`, `April`, `May`, `June`, `July`, \n `August`, ` September`, `October`, `November`, `December`]:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 13 "t := ctime():" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 136 "cat(months[t[2]], ` `, t[3], `, `, t[1], ` - `, t[4] , `:`, \n `if`(t[5] < 10, `0`, NULL), t[5], `:`, `if`(t[6] < 10, `0` , NULL), t[6]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#% " 0 "" {MPLTEXT 1 0 13 "ctime(`GMT`) ;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7(\"%)*>\"#5\"#<\"#;\"\")\"#f" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "ctime(`CET`);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#7(\"%)*>\"#5\"# " 0 "" {MPLTEXT 1 0 14 "ctime(`MEST`);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7(\"%)*>\"#5\"#<\"#=\"\"*\"\"!" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "ctime(`EDT`);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7(\" %)*>\"#5\"#<\"#7\"\"*\"\"$" }}}}{MARK "2 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 }