-
Notifications
You must be signed in to change notification settings - Fork 0
/
想界暦(想→現).hsp
48 lines (48 loc) · 1.51 KB
/
想界暦(想→現).hsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "hspmath.as"
#module
#include "hspmath.as"
#defcfunc julius_i int yearI, int monthI, int day
if monthI=12:month=0:year=yearI+1:else:month=monthI:year=yearI
jday=floor(354.75*(year-3))-floor(1.0*year/400)+floor(1.0*year/100)+day-703602
if month=0:jday=jday+0
if month=1:jday=jday+29
if month=2:jday=jday+58
if month=3:jday=jday+88
if month=4:jday=jday+117
if month=5:jday=jday+147
if month=6:jday=jday+176
if month=7:jday=jday+206
if month=8:jday=jday+235
if month=9:jday=jday+264
if month=10:jday=jday+294
if month=11:jday=jday+323
return jday
#global
#module
#include "hspmath.as"
#defcfunc julius int yearI, int monthI, int day
if monthI<=2:month=monthI+12:year=yearI-1:else:month=monthI:year=yearI
jday=floor(365.25*year)+floor(1.0*year/400)-floor(1.0*year/100)+floor(30.59*(month-2))+day-678912
return jday
#global
screen 0,640,480
mes julius_i(1986,4,1)
year_i=2021
month_i=1
day_i=1
time_i=0.0
elapse_i=julius_i(year_i,month_i,day_i)-julius_i(1986,4,1)+time_i;19870401e=19860401i
elapse_e=1.0*elapse_i*85874.08/86400
time_e=elapse_e-floor(elapse_e)
elapse_fe=int(elapse_e)
n=elapse_fe+julius(1987,4,1)+678881
a=4*n+3+4*floor(3.0/4*floor(4*(n+1)/146097+1))
b=5*floor(1.0*(a \ 1461)/4)+2
year_e=int(1.0*a/1461)
month_e=int(1.0*b/153)+3
day_e=int(1.0*(b \ 153)/5)+1
if month_e>=13:year_e=year_e+1:month_e=month_e-12
hour_e=int(time_e*24)
minute_e=int((time_e*24-hour_e)*60)
second_e=int(((time_e*24-hour_e)*60-minute_e)*60)
mes ""+year_e+"/"+month_e+"/"+day_e+"\n"+hour_e+":"+minute_e+":"+second_e