It's a little trick that Rails adds to Ruby
1、切换到 rails console 下
2、运行:
1.hour => 3600 seconds
1.hour.class => Fixnum
+++++++++++++++++++++++++++++++++++++++++++
E:\awe\awe-source-code\awe-server-code\awe-server\awe>rails console
Loading development environment (Rails 3.0.9)
irb(main):001:0> 1.hour
=> 3600 seconds
irb(main):002:0> 1.hour.class
=> Fixnum
irb(main):003:0> 1.minute
=> 60 seconds
++++++++++++++++++++++++++++++++++++++++++++
irb(main):014:0> 1.hour.from_now
=> Mon, 10 Oct 2011 09:00:41 UTC +00:00
irb(main):015:0> 1.hour.from_now.class
=> ActiveSupport::TimeWithZone
irb(main):016:0>
- 大小: 59.9 KB
分享到:
相关推荐
System.out.print(mycalendar1.get(Calendar.MONTH) + "月"); System.out.println(mycalendar1.get(Calendar.DATE) + "日"); System.out.println("今日时间: "); System.out.print(mycalendar1.get...
System.out.print(mycalendar1.get(Calendar.MONTH) + "月"); System.out.println(mycalendar1.get(Calendar.DATE) + "日"); System.out.println("今日时间: "); System.out.print(mycalendar1.get...
1 1. 函数和公式 ................................................................................................................ 1 [1]. 什么是函数 .......................................................
9.MONTH............................. 5 10.NETWORKDAYS ........... 5 11.NOW..........…................... 6 12.SECOND..….................... 6 13.TIME.........…................... 6 14.TIME...
1 公式向导 ...................................................................................................................................... 4 2 函数参考 ............................................
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime() 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now 1.2 取当前年 int 年=currentTime.Year 1.3 取当前月 int 月=currentTime....
int month = c.get(Calendar.MONTH)+1; int day = c.get(Calendar.DATE); int hour = c.get(Calendar.HOUR); int minute = c.get(Calendar.MINUTE); int second = c.get(Calendar.SECOND); 如何取得从...
1. 2.DAYOFWEEK(date) 3.WEEKDAY(date) 4.DAYOFMONTH(date) 5.DAYOFYEAR(date) 6.MONTH(date) 7.DAYNAME(date) 8.MONTHNAME(date) 9.QUARTER(date) 10.WEEK(date) WEEK(date,first) 11.YEAR(date) 12.HOUR(time) 13....
{minute} {hour} {day-of-month} {month} {day-of-week} {full-path-to-shell-script} o minute:区间为 0 – 59 o hour:区间为0 – 23 o day-of-month:区间为0 – 31 o month:区间...
Log.e("time_now", ""+year+"_"+month+1+"_"+day+"_"+hour+"_"+minute); SimpleDateFormat formatter = new SimpleDateFormat ("yyyy年MM月dd日 HH:mm:ss"); Date curDate = new Date(System.currentTimeMillis...
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=...
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=...
public void onCreate(Bundle savedInstanceState) { super.onCreate... mHour = c.get(Calendar.HOUR_OF_DAY); mMinute = c.get(Calendar.MINUTE); setDateTime(); setTimeOfDay(); }
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=...
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=...
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=...
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=...
/// 格式后的异常信息字符串,包括异常内容和跟踪堆栈. /// /// public static String FormatException(Exception ex, String catchInfo) { StringBuilder strBuilder = new StringBuilder(); if ...
获取和格式化时间实用笔记1.日期格式化 Date.prototype.format = function(format) { var o = { "M+" : this.getMonth()+1, //month "d+" : this.getDate(), //day "h+" : this.getHours(), //hour "m+" : ...
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=...