博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
oracle to_timestamp and to_date
阅读量:6881 次
发布时间:2019-06-27

本文共 1183 字,大约阅读时间需要 3 分钟。

Oracle/PLSQL: To_Timestamp Function


In Oracle/PLSQL, the to_timestamp function converts a string to a timestamp.

The syntax for the to_timestamp function is:

to_timestamp( string1, [ format_mask ] [ 'nlsparam' ] )

string1 is the string that will be converted to a timestamp.

format_mask is optional. This is the format that will be used to convert string1 to a timestamp.

 

The following is a list of options for the format_mask parameter. These parameters can be used in many combinations.

Parameter Explanation
YYYY 4-digit year
MM Month (01-12; JAN = 01).
MON Abbreviated name of month.
MONTH Name of month, padded with blanks to length of 9 characters.
DD Day of month (1-31).
HH Hour of day (1-12).
HH12 Hour of day (1-12).
HH24 Hour of day (0-23).
MI Minute (0-59).
SS Second (0-59).

 

Applies To:

  • Oracle 9i, Oracle 10g, Oracle 11g

 

For example:

to_timestamp('2003/12/13 10:13:18', 'YYYY/MM/DD HH:MI:SS')

would return '13-DEC-03 10.13.18.000000000 AM' as a timestamp value.

 

to_timestamp('2003/DEC/13 10:13:18', 'YYYY/MON/DD HH:MI:SS')

would also return '13-DEC-03 10.13.18.000000000 AM' as a timestamp value.

转载于:https://www.cnblogs.com/dongxiaoguang/archive/2013/03/14/2960232.html

你可能感兴趣的文章
C++文件操作(fstream)
查看>>
用main函数传参做简单的计算器的代码
查看>>
python中struct.unpack的用法
查看>>
体绘制(Volume Rendering)概述之4:光线投射算法(Ray Casting)实现流程和代码(基于CPU的实现)...
查看>>
Python实践之(七)逻辑回归(Logistic Regression)
查看>>
PAT (Advanced Level) 1107. Social Clusters (30)
查看>>
【开源社群系统研发日记五】ThinkSNS+ 是如何计算字符显示长度的
查看>>
Nodejs日志管理log4js
查看>>
python获取昨日日期
查看>>
海康威视 - 萤石云开放平台 js 版
查看>>
关于分销平台
查看>>
剑指offer---12-**--数值的整数次方
查看>>
PAT - L2-010. 排座位(并查集)
查看>>
Linux下chkconfig命令详解(转)
查看>>
EF中,保存实体报错:Validation failed for one or more entities. 如何知道具体错误在哪?...
查看>>
和积式
查看>>
你不能错过.net 并发解决方案
查看>>
[PHP] 超全局变量$_FILES上传文件
查看>>
linux如何添加telnet服务
查看>>
解决Windows对JDK默认版本切换问题
查看>>