`
ch_kexin
  • 浏览: 876509 次
  • 性别: Icon_minigender_2
  • 来自: 青岛
社区版块
存档分类
最新评论

AS3 String to Date

 
阅读更多
var formatterString:String = "YYYY-MM-DD LL:NN:SS";

// Y是年  M是月  D是天  L是小时  N是分  S是秒  E是周

public function dateFormat (   formatterString:String   ):String{   //格式化日期
              var dateFormatter:DateFormatter = new DateFormatter();
              dateFormatter.formatString = formatterString;
              return dateFormatter.format(new Date);
}


//  AS3中转换String  to Date 有严格的格式规定,因此先要格式化日期 “2010-02-11 11:06:12”

var date:Date = DateFormatter.parseDateString( “2010-02-11 11:06:12” );

//得到标准的日期date
分享到:
评论

相关推荐

    Building AS400 Internet-Based Applications with Java

    Building AS400 Internet-Based Applications

    105s print label set

    使用vb控制105s打印机指令打印标签,Private Sub Print_Test_SN(Model_Name As String, WeekDate As Date, SN As Long) Dim filehandle As Integer Dim ModelName As String Dim yearweek As String Dim str_...

    JavaChineseCalendar

    For example, we want to create a **農曆** object instance with the date 2015-12-16 in Chinese calendar and we know that date is not in a leap month. The code will be, 農曆 date = 農曆.建立(2015, 12,...

    Mysql 日期时间 DATE_FORMAT(date,format)

    Formats the date value according to the format string. The following specifiers may be used in the format string. As of MySQL 3.23, the “%” character is required before format spe

    math function

    Public Shared Function CYYYYMMToMMM(ByVal RegionName As String, ByVal sYYYYMM As String) As String 'Convert month formatn egg .convert "201101" to "Jan" 'Note: string start position is begin form 0...

    au3反编译源码

    > myScript_decompiled.au3 | > ...AutoIt3\autoit-v3.1.0\Include\Date.au3 ... | ... Func Fn0020($Arg00, $Arg01) | Func _DateMonthOfYear($iMonthNum, $iShort) Local $Arr0000[0x000D] | ;===============...

    VB6扩展方法自定义支持

    Welcome to the VB6Extend wiki! 一、 ZLCustomExtend 2 1、背景 2 ...Function INI_GetValue(ByVal filename As String, ByVal AppName As String, ByVal KeyName As String) As String 说明 Win

    vb 万年历代码

    Dim dateList(1900 To 2011) As String * 18 Dim conDate As Date, setDate As Date Dim AddMonth As Integer, AddDay As Integer, AddYear As Integer, getDay As Integer Dim RunYue As Boolean If ...

    servlet2.4doc

    The default behavior of this method is to call addDateHeader(String name, long date) on the wrapped response object. addDateHeader(String, long) - Method in interface javax.servlet....

    OutlookAttachView v2.73

    string..., From string, and To string, and you can easily select a string again from a Combo-Box. * Version 2.47 o Added option to choose another font (font name and size) to display the ...

    ajax web service

    string strSQL = "select CONVERT(varchar(2) , CommitDate, 109 ) as date from CostInfo where c_sid=" + uid + " and GCPWF='" + _GCPWF + "'"; DataSet dss = db.GetDs(strSQL, ConnStr); string Date = dss....

    Scala Data Analysis Cookbook(PACKT,2015)

    Starting with introductory recipes on utilizing the Breeze and Spark libraries, get to grips withhow to import data from a host of possible sources and how to pre-process numerical, string, and date ...

    Foundations for Analytics with Python O-Reilly-2016-Clinton W. Brownley

    This is a reminder that you can parse text files with basic string oper‐ ations and another good example of how to use a nested dictionary to group or bin data into unique categories. Chapter 6, ...

    基于数据库的VB课程设计

    Dim SQL As String Dim rs As ADODB.Recordset 沈 阳 大 学 课程设计说明书 NO.16 If Trim(UserName.Text = "") Then MsgBox "没有输入用户名称,请重新输入!", vbOKOnly + vbExclamation, "警告" UserName....

    oracle使用管理笔记(一些经验的总结)

    (7) to_date(string,'format') 28 (8)系统函数 29 14.oracle创建数据库实例 30 15.java操作oracle 31 16.oracle事务处理 34 17.oracle数据完整性 36 18.oracle 序列(sequence) 39 19.oracle 索引 40 20.oracle管理...

    时间戳的工具类

    * This class is converts a java.util.Date to a String and a String to a * java.util.Date for use as a Timestamp. It is used by BeanUtils when copying * properties.

    json.js_json2.js

    return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6])); } } return value; }); myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { var d; if (typeof value ===...

    Java邮件开发Fundamentals of the JavaMail API

    javamail1_1_3.zip file, and add the mail.jar file to your CLASSPATH. The 1.1.3 implementation comes with an SMTP and IMAP4 provider, besides the core classes. If you want to access a POP server ...

    C# 6 and .NET Core 1.0: Modern Cross-Platform Development

    as well as object-orient programming, before taking a quick tour through the latest features of C# 6 such as string interpolation for easier variable value output, exception filtering, and how to ...

    微软内部资料-SQL性能优化3

    To support SERIALIZABLE transaction semantics, SQL Server needs to lock sets of rows specified by a predicate, such as WHERE salary BETWEEN 30000 AND 50000 SQL Server needs to lock data that does ...

Global site tag (gtag.js) - Google Analytics