-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDateUtils
More file actions
681 lines (625 loc) · 22.9 KB
/
Copy pathDateUtils
File metadata and controls
681 lines (625 loc) · 22.9 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
import java.util.Calendar;
import java.util.Date;
import android.content.Context;
/**
* @ClassName: DateUtils
* @Description: 时间相关
*/
public final class DateUtils {
//下面几个函数来自gson
/**
* Format a date into 'yyyy-MM-ddThh:mm:ssZ' (default timezone, no milliseconds precision)
*
* @param date the date to format
* @return the date formatted as 'yyyy-MM-ddThh:mm:ssZ'
*/
public static String format(Date date) {
return format(date, false, TIMEZONE_UTC);
}
/**
* Format a date into 'yyyy-MM-ddThh:mm:ss[.sss]Z' (GMT timezone)
*
* @param date the date to format
* @param millis true to include millis precision otherwise false
* @return the date formatted as 'yyyy-MM-ddThh:mm:ss[.sss]Z'
*/
public static String format(Date date, boolean millis) {
return format(date, millis, TIMEZONE_UTC);
}
/**
* Format date into yyyy-MM-ddThh:mm:ss[.sss][Z|[+-]hh:mm]
*
* @param date the date to format
* @param millis true to include millis precision otherwise false
* @param tz timezone to use for the formatting (UTC will produce 'Z')
* @return the date formatted as yyyy-MM-ddThh:mm:ss[.sss][Z|[+-]hh:mm]
*/
public static String format(Date date, boolean millis, TimeZone tz) {
Calendar calendar = new GregorianCalendar(tz, Locale.US);
calendar.setTime(date);
// estimate capacity of buffer as close as we can (yeah, that's pedantic ;)
int capacity = "yyyy-MM-ddThh:mm:ss".length();
capacity += millis ? ".sss".length() : 0;
capacity += tz.getRawOffset() == 0 ? "Z".length() : "+hh:mm".length();
StringBuilder formatted = new StringBuilder(capacity);
padInt(formatted, calendar.get(Calendar.YEAR), "yyyy".length());
formatted.append('-');
padInt(formatted, calendar.get(Calendar.MONTH) + 1, "MM".length());
formatted.append('-');
padInt(formatted, calendar.get(Calendar.DAY_OF_MONTH), "dd".length());
formatted.append('T');
padInt(formatted, calendar.get(Calendar.HOUR_OF_DAY), "hh".length());
formatted.append(':');
padInt(formatted, calendar.get(Calendar.MINUTE), "mm".length());
formatted.append(':');
padInt(formatted, calendar.get(Calendar.SECOND), "ss".length());
if (millis) {
formatted.append('.');
padInt(formatted, calendar.get(Calendar.MILLISECOND), "sss".length());
}
int offset = tz.getOffset(calendar.getTimeInMillis());
if (offset != 0) {
int hours = Math.abs((offset / (60 * 1000)) / 60);
int minutes = Math.abs((offset / (60 * 1000)) % 60);
formatted.append(offset < 0 ? '-' : '+');
padInt(formatted, hours, "hh".length());
formatted.append(':');
padInt(formatted, minutes, "mm".length());
} else {
formatted.append('Z');
}
return formatted.toString();
}
/*
/**********************************************************
/* Parsing
/**********************************************************
*/
/**
* Parse a date from ISO-8601 formatted string. It expects a format
* [yyyy-MM-dd|yyyyMMdd][T(hh:mm[:ss[.sss]]|hhmm[ss[.sss]])]?[Z|[+-]hh[:mm]]]
*
* @param date ISO string to parse in the appropriate format.
* @param pos The position to start parsing from, updated to where parsing stopped.
* @return the parsed date
* @throws ParseException if the date is not in the appropriate format
*/
public static Date parse(String date, ParsePosition pos) throws ParseException {
Exception fail = null;
try {
int offset = pos.getIndex();
// extract year
int year = parseInt(date, offset, offset += 4);
if (checkOffset(date, offset, '-')) {
offset += 1;
}
// extract month
int month = parseInt(date, offset, offset += 2);
if (checkOffset(date, offset, '-')) {
offset += 1;
}
// extract day
int day = parseInt(date, offset, offset += 2);
// default time value
int hour = 0;
int minutes = 0;
int seconds = 0;
int milliseconds = 0; // always use 0 otherwise returned date will include millis of current time
// if the value has no time component (and no time zone), we are done
boolean hasT = checkOffset(date, offset, 'T');
if (!hasT && (date.length() <= offset)) {
Calendar calendar = new GregorianCalendar(year, month - 1, day);
pos.setIndex(offset);
return calendar.getTime();
}
if (hasT) {
// extract hours, minutes, seconds and milliseconds
hour = parseInt(date, offset += 1, offset += 2);
if (checkOffset(date, offset, ':')) {
offset += 1;
}
minutes = parseInt(date, offset, offset += 2);
if (checkOffset(date, offset, ':')) {
offset += 1;
}
// second and milliseconds can be optional
if (date.length() > offset) {
char c = date.charAt(offset);
if (c != 'Z' && c != '+' && c != '-') {
seconds = parseInt(date, offset, offset += 2);
if (seconds > 59 && seconds < 63) seconds = 59; // truncate up to 3 leap seconds
// milliseconds can be optional in the format
if (checkOffset(date, offset, '.')) {
offset += 1;
int endOffset = indexOfNonDigit(date, offset + 1); // assume at least one digit
int parseEndOffset = Math.min(endOffset, offset + 3); // parse up to 3 digits
int fraction = parseInt(date, offset, parseEndOffset);
// compensate for "missing" digits
switch (parseEndOffset - offset) { // number of digits parsed
case 2:
milliseconds = fraction * 10;
break;
case 1:
milliseconds = fraction * 100;
break;
default:
milliseconds = fraction;
}
offset = endOffset;
}
}
}
}
// extract timezone
if (date.length() <= offset) {
throw new IllegalArgumentException("No time zone indicator");
}
TimeZone timezone = null;
char timezoneIndicator = date.charAt(offset);
if (timezoneIndicator == 'Z') {
timezone = TIMEZONE_UTC;
offset += 1;
} else if (timezoneIndicator == '+' || timezoneIndicator == '-') {
String timezoneOffset = date.substring(offset);
// When timezone has no minutes, we should append it, valid timezones are, for example: +00:00, +0000 and +00
timezoneOffset = timezoneOffset.length() >= 5 ? timezoneOffset : timezoneOffset + "00";
offset += timezoneOffset.length();
// 18-Jun-2015, tatu: Minor simplification, skip offset of "+0000"/"+00:00"
if ("+0000".equals(timezoneOffset) || "+00:00".equals(timezoneOffset)) {
timezone = TIMEZONE_UTC;
} else {
// 18-Jun-2015, tatu: Looks like offsets only work from GMT, not UTC...
// not sure why, but that's the way it looks. Further, Javadocs for
// `java.util.TimeZone` specifically instruct use of GMT as base for
// custom timezones... odd.
String timezoneId = "GMT" + timezoneOffset;
// String timezoneId = "UTC" + timezoneOffset;
timezone = TimeZone.getTimeZone(timezoneId);
String act = timezone.getID();
if (!act.equals(timezoneId)) {
/* 22-Jan-2015, tatu: Looks like canonical version has colons, but we may be given
* one without. If so, don't sweat.
* Yes, very inefficient. Hopefully not hit often.
* If it becomes a perf problem, add 'loose' comparison instead.
*/
String cleaned = act.replace(":", "");
if (!cleaned.equals(timezoneId)) {
throw new IndexOutOfBoundsException("Mismatching time zone indicator: "+timezoneId+" given, resolves to "
+timezone.getID());
}
}
}
} else {
throw new IndexOutOfBoundsException("Invalid time zone indicator '" + timezoneIndicator+"'");
}
Calendar calendar = new GregorianCalendar(timezone);
calendar.setLenient(false);
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, month - 1);
calendar.set(Calendar.DAY_OF_MONTH, day);
calendar.set(Calendar.HOUR_OF_DAY, hour);
calendar.set(Calendar.MINUTE, minutes);
calendar.set(Calendar.SECOND, seconds);
calendar.set(Calendar.MILLISECOND, milliseconds);
pos.setIndex(offset);
return calendar.getTime();
// If we get a ParseException it'll already have the right message/offset.
// Other exception types can convert here.
} catch (IndexOutOfBoundsException e) {
fail = e;
} catch (NumberFormatException e) {
fail = e;
} catch (IllegalArgumentException e) {
fail = e;
}
String input = (date == null) ? null : ('"' + date + "'");
String msg = fail.getMessage();
if (msg == null || msg.isEmpty()) {
msg = "("+fail.getClass().getName()+")";
}
ParseException ex = new ParseException("Failed to parse date [" + input + "]: " + msg, pos.getIndex());
ex.initCause(fail);
throw ex;
}
/**
* @Title: getIntervalYear
* @Description: 计算两个时间相差的年数
* @param beginTime 开始时间
* @param endTime 结束时间
* @return 相差的年数(endTime - beginTime)。如果beginTime > endTime,则返回相差年数的负值
*/
public static int getIntervalYear(long beginTime, long endTime) {
Calendar cal1 = Calendar.getInstance();
cal1.setTimeInMillis(beginTime);
Calendar cal2 = Calendar.getInstance();
cal2.setTimeInMillis(endTime);
return cal2.get(Calendar.YEAR) - cal1.get(Calendar.YEAR);
}
public static int getIntervalDay(long beginTime, long endTime) {
Calendar cal1 = Calendar.getInstance();
cal1.setTimeInMillis(beginTime);
Calendar cal2 = Calendar.getInstance();
cal2.setTimeInMillis(endTime);
return cal2.get(Calendar.DAY_OF_YEAR) - cal1.get(Calendar.DAY_OF_YEAR);
}
/**
* @Title: isSampleDay
* @Description: 是否是同一天
* @param time1 the first date(UTC milliseconds)
* @param time2 the second date(UTC milliseconds)
* @return true
*/
public static boolean isSameDay(long time1, long time2) {
Calendar cal1 = Calendar.getInstance();
cal1.setTimeInMillis(time1);
Calendar cal2 = Calendar.getInstance();
cal2.setTimeInMillis(time2);
return isSameDay(cal1, cal2);
}
/**
* <p>
* Checks if two dates are on the same day ignoring time.
* </p>
* @param date1 the first date, not altered, not null
* @param date2 the second date, not altered, not null
* @return true if they represent the same day
* @throws IllegalArgumentException if either date is <code>null</code>
*/
public static boolean isSameDay(Date date1, Date date2) {
if (date1 == null || date2 == null) {
throw new IllegalArgumentException("The dates must not be null");
}
Calendar cal1 = Calendar.getInstance();
cal1.setTime(date1);
Calendar cal2 = Calendar.getInstance();
cal2.setTime(date2);
return isSameDay(cal1, cal2);
}
/**
* <p>
* Checks if two calendars represent the same day ignoring time.
* </p>
* @param cal1 the first calendar, not altered, not null
* @param cal2 the second calendar, not altered, not null
* @return true if they represent the same day
* @throws IllegalArgumentException if either calendar is <code>null</code>
*/
public static boolean isSameDay(Calendar cal1, Calendar cal2) {
if (cal1 == null || cal2 == null) {
throw new IllegalArgumentException("The dates must not be null");
}
return (cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA) && cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && cal1
.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR));
}
/**
* <p>
* Checks if a date is today.
* </p>
* @param date the date, not altered, not null.
* @return true if the date is today.
* @throws IllegalArgumentException if the date is <code>null</code>
*/
public static boolean isToday(Date date) {
return isSameDay(date, Calendar.getInstance().getTime());
}
/**
* <p>
* Checks if a calendar date is today.
* </p>
* @param cal the calendar, not altered, not null
* @return true if cal date is today
* @throws IllegalArgumentException if the calendar is <code>null</code>
*/
public static boolean isToday(Calendar cal) {
return isSameDay(cal, Calendar.getInstance());
}
/**
* <p>
* Checks if the first date is before the second date ignoring time.
* </p>
* @param date1 the first date, not altered, not null
* @param date2 the second date, not altered, not null
* @return true if the first date day is before the second date day.
* @throws IllegalArgumentException if the date is <code>null</code>
*/
public static boolean isBeforeDay(Date date1, Date date2) {
if (date1 == null || date2 == null) {
throw new IllegalArgumentException("The dates must not be null");
}
Calendar cal1 = Calendar.getInstance();
cal1.setTime(date1);
Calendar cal2 = Calendar.getInstance();
cal2.setTime(date2);
return isBeforeDay(cal1, cal2);
}
/**
* <p>
* Checks if the first calendar date is before the second calendar date
* ignoring time.
* </p>
* @param cal1 the first calendar, not altered, not null.
* @param cal2 the second calendar, not altered, not null.
* @return true if cal1 date is before cal2 date ignoring time.
* @throws IllegalArgumentException if either of the calendars are
* <code>null</code>
*/
public static boolean isBeforeDay(Calendar cal1, Calendar cal2) {
if (cal1 == null || cal2 == null) {
throw new IllegalArgumentException("The dates must not be null");
}
if (cal1.get(Calendar.ERA) < cal2.get(Calendar.ERA))
return true;
if (cal1.get(Calendar.ERA) > cal2.get(Calendar.ERA))
return false;
if (cal1.get(Calendar.YEAR) < cal2.get(Calendar.YEAR))
return true;
if (cal1.get(Calendar.YEAR) > cal2.get(Calendar.YEAR))
return false;
return cal1.get(Calendar.DAY_OF_YEAR) < cal2.get(Calendar.DAY_OF_YEAR);
}
/**
* <p>
* Checks if the first date is after the second date ignoring time.
* </p>
* @param date1 the first date, not altered, not null
* @param date2 the second date, not altered, not null
* @return true if the first date day is after the second date day.
* @throws IllegalArgumentException if the date is <code>null</code>
*/
public static boolean isAfterDay(Date date1, Date date2) {
if (date1 == null || date2 == null) {
throw new IllegalArgumentException("The dates must not be null");
}
Calendar cal1 = Calendar.getInstance();
cal1.setTime(date1);
Calendar cal2 = Calendar.getInstance();
cal2.setTime(date2);
return isAfterDay(cal1, cal2);
}
/**
* <p>
* Checks if the first calendar date is after the second calendar date
* ignoring time.
* </p>
* @param cal1 the first calendar, not altered, not null.
* @param cal2 the second calendar, not altered, not null.
* @return true if cal1 date is after cal2 date ignoring time.
* @throws IllegalArgumentException if either of the calendars are
* <code>null</code>
*/
public static boolean isAfterDay(Calendar cal1, Calendar cal2) {
if (cal1 == null || cal2 == null) {
throw new IllegalArgumentException("The dates must not be null");
}
if (cal1.get(Calendar.ERA) < cal2.get(Calendar.ERA))
return false;
if (cal1.get(Calendar.ERA) > cal2.get(Calendar.ERA))
return true;
if (cal1.get(Calendar.YEAR) < cal2.get(Calendar.YEAR))
return false;
if (cal1.get(Calendar.YEAR) > cal2.get(Calendar.YEAR))
return true;
return cal1.get(Calendar.DAY_OF_YEAR) > cal2.get(Calendar.DAY_OF_YEAR);
}
/**
* <p>
* Checks if a date is after today and within a number of days in the
* future.
* </p>
* @param date the date to check, not altered, not null.
* @param days the number of days.
* @return true if the date day is after today and within days in the future
* .
* @throws IllegalArgumentException if the date is <code>null</code>
*/
public static boolean isWithinDaysFuture(Date date, int days) {
if (date == null) {
throw new IllegalArgumentException("The date must not be null");
}
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return isWithinDaysFuture(cal, days);
}
/**
* <p>
* Checks if a calendar date is after today and within a number of days in
* the future.
* </p>
* @param cal the calendar, not altered, not null
* @param days the number of days.
* @return true if the calendar date day is after today and within days in
* the future .
* @throws IllegalArgumentException if the calendar is <code>null</code>
*/
public static boolean isWithinDaysFuture(Calendar cal, int days) {
if (cal == null) {
throw new IllegalArgumentException("The date must not be null");
}
Calendar today = Calendar.getInstance();
Calendar future = Calendar.getInstance();
future.add(Calendar.DAY_OF_YEAR, days);
return (isAfterDay(cal, today) && !isAfterDay(cal, future));
}
/** Returns the given date with the time set to the start of the day. */
public static Date getStart(Date date) {
return clearTime(date);
}
/** Returns the given date with the time values cleared. */
public static Date clearTime(Date date) {
if (date == null) {
return null;
}
Calendar c = Calendar.getInstance();
c.setTime(date);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
return c.getTime();
}
/**
* Determines whether or not a date has any time values (hour, minute,
* seconds or millisecondsReturns the given date with the time values
* cleared.
*/
/**
* Determines whether or not a date has any time values.
* @param date The date.
* @return true iff the date is not null and any of the date's hour, minute,
* seconds or millisecond values are greater than zero.
*/
public static boolean hasTime(Date date) {
if (date == null) {
return false;
}
Calendar c = Calendar.getInstance();
c.setTime(date);
if (c.get(Calendar.HOUR_OF_DAY) > 0) {
return true;
}
if (c.get(Calendar.MINUTE) > 0) {
return true;
}
if (c.get(Calendar.SECOND) > 0) {
return true;
}
if (c.get(Calendar.MILLISECOND) > 0) {
return true;
}
return false;
}
/** Returns the given date with time set to the end of the day */
public static Date getEnd(Date date) {
if (date == null) {
return null;
}
Calendar c = Calendar.getInstance();
c.setTime(date);
c.set(Calendar.HOUR_OF_DAY, 23);
c.set(Calendar.MINUTE, 59);
c.set(Calendar.SECOND, 59);
c.set(Calendar.MILLISECOND, 999);
return c.getTime();
}
/**
* Returns the maximum of two dates. A null date is treated as being less
* than any non-null date.
*/
public static Date max(Date d1, Date d2) {
if (d1 == null && d2 == null)
return null;
if (d1 == null)
return d2;
if (d2 == null)
return d1;
return (d1.after(d2)) ? d1 : d2;
}
/**
* Returns the minimum of two dates. A null date is treated as being greater
* than any non-null date.
*/
public static Date min(Date d1, Date d2) {
if (d1 == null && d2 == null)
return null;
if (d1 == null)
return d2;
if (d2 == null)
return d1;
return (d1.before(d2)) ? d1 : d2;
}
/** The maximum date possible. */
public static Date MAX_DATE = new Date(Long.MAX_VALUE);
/**
* @Title: getConstellation
* @Description: 根据月与日得到星座
* @param m 月份
* @param d 日份
* @return 星座
*/
public static String getAstro(Context context, int month, int day) {
// 星座 日期(公历) 英文名
// 魔羯座 (12/22 - 1/19) Capricorn
// 水瓶座 (1/20 - 2/18) Aquarius
// 双鱼座 (2/19 - 3/20) Pisces
// 牡羊座 (3/21 - 4/20) Aries
// 金牛座 (4/21 - 5/20) Taurus
// 双子座 (5/21 - 6/21) Gemini
// 巨蟹座 (6/22 - 7/22) Cancer
// 狮子座 (7/23 - 8/22) Leo
// 处女座 (8/23 - 9/22) Virgo
// 天秤座 (9/23 - 10/22) Libra
// 天蝎座 (10/23 - 11/21) Scorpio
// 射手座 (11/22 - 12/21) Sagittarius
final String[] astroArr = context.getResources().getStringArray(R.array.astros);
//月份 1 2 3 4 5 6 7 8 9 10 11 12
final int[] constellationEdgeDay = { 19, 18, 20, 19, 20, 21, 22, 22, 22, 23, 22, 21 };
if (day > 31 || day < 1)
return "";
else {
switch (month) {
case 1:
if (day <= constellationEdgeDay[0])
return astroArr[0];
else
return astroArr[1];
case 2:
if (day <= constellationEdgeDay[1])
return astroArr[1];
else
return astroArr[2];
case 3:
if (day <= constellationEdgeDay[2])
return astroArr[2];
else
return astroArr[3];
case 4:
if (day <= constellationEdgeDay[3])
return astroArr[3];
else
return astroArr[4];
case 5:
if (day <= constellationEdgeDay[4])
return astroArr[4];
else
return astroArr[5];
case 6:
if (day <= constellationEdgeDay[5])
return astroArr[5];
else
return astroArr[6];
case 7:
if (day <= constellationEdgeDay[6])
return astroArr[6];
else
return astroArr[7];
case 8:
if (day <= constellationEdgeDay[7])
return astroArr[7];
else
return astroArr[8];
case 9:
if (day <= constellationEdgeDay[8])
return astroArr[8];
else
return astroArr[9];
case 10:
if (day <= constellationEdgeDay[9])
return astroArr[9];
else
return astroArr[10];
case 11:
if (day <= constellationEdgeDay[10])
return astroArr[10];
else
return astroArr[11];
case 12:
if (day <= constellationEdgeDay[11])
return astroArr[11];
else
return astroArr[0];
default:
return "";
}
}
}
}