- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这可能是一个非常简单的问题,但是:
我正在尝试将文件命名为 TestSheet.hhmmssnnnccyymmdd
我在 SSIS 中设置了一个变量,并且表达式生成器中的表达式设置为:
@[用户::str_Var] +
Right("0"+ (DT_STR,4,1252) DatePart("hh",getdate()),2) +
右("0"+ (DT_STR,4,1252) DatePart("mi",getdate()),2) +
Right("0"+ (DT_STR,4,1252) DatePart("ss",getdate()),2) + ".txt"
我知道:
Right("0"+ (DT_STR,4,1252) DatePart("m",getdate()),2) +
Right("0"+ (DT_STR,4,1252) DatePart("d",getdate()),2)
会给我“mm”和dd“
我的问题是..我有“hh mm ss mm dd”,我如何获得“nnnccyy”?
最佳答案
即使您要求纳秒(十亿分之一),我假设您的意思是毫秒(千分之一)精度。 DATEPART仅提供毫秒精度的切片器。
使用表达式,构建格式字符串的位将如下所示
Right("0" + (DT_STR,2,1252) DatePart("hh",getdate()),2)
+ Right("0" + (DT_STR,2,1252) DatePart("mi",getdate()),2)
+ Right("0" + (DT_STR,4,1252) DatePart("ss",getdate()),2)
+ Right("000" + (DT_STR,3,1252) datepart("Ms", getdate()),3)
+ (DT_STR,4,1252) datepart("yyyy", getdate())
+ (DT_STR,2,1252) datepart("mm", getdate())
+ (DT_STR,2,1252) datepart("dd", getdate())
我不知道 getdate 内部是如何工作的,但在研究中我确实发现了这个问题 What is the best way to measure how long code takes to execute?但我认为它基本上是调用来自 Eric Lippert 的 DateTime.Now
Money 报价,但这一个是最相关的。
Note that "wall clock time" measured by DateTime is only accurate to something like 30 ms. DateTime is for representing things like a clock on the wall, or the time you last edited a file; it doens't have to have nanosecond accuracy, and so it does not
如果你必须达到纳秒精度,那么快乐狩猎,但表达式不会解决它。正如 @fegemo 所指出的,脚本任务可以让您达到百万分之一 custom formatting但这距离您期望的精度仍然有两个数量级。
this.Dts.Variables["User::CustomFormat"].Value = DateTime.Now.ToString("HHmmssfffffyyyyMMdd");
关于SSIS 填充日期时间格式 : "hh mm ss nnn cc yy mm dd",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13650927/
如标题所示,我有一个问题。我需要将 LocalDataTime yyyy-MM-ssThh-mm-ss 解析为 LocalDataTime yyyy-MM-ss hh-mm-ss 但是当我这样做时 S
我使用“cin”从输入流中读取单词,比如 int main( ){ string word; while (cin >> word){ //do sth on t
我有一个 Java 函数可以将秒数转换为特定格式 (hh:mm:ss): public static String formatChronometer(long seconds) { retu
(学习C++)我一直在看下面的代码部分: stringstream ss; // more code ss.clear(); ss.str(""); 为什么 ss.str(""); 调用时 ss.cl
我有一个从 GPS 跟踪器收集的数据集。数据中的总时间应为 mm:ss。但 Excel 将其解释为小时和分钟。 如何使用公式将其转换为分钟和秒?在下面的示例中,32 应该是 32 分钟,15 应该是
我的时间格式如下 public static final String TIME_FORMAT = "HH:mm:ss.SS"; edition.getEditionDate().format(T
我正在尝试对以下示例进行转换: 原始时间:1:03.091 转换时间:63.09 我做了一些研究,发现我可以将分钟添加到秒,但不知道如何添加毫秒。以下是我迄今为止所做的事情: a = "01:40.4
我有一个包含秒数的 float8,即 65.455。我试图在 View 中设置列的格式,使其显示为 1:05.455。 像这样使用 postgres 命令:TO_CHAR((user_data.tot
我有 vba 问题,我一直试图找到答案很长时间。我有来自众多客户的大量电子表格,我在这些电子表格上运行宏,我是编码新手,并且能够大致弄清楚我需要做什么。我的客户每月向我们发送数据,并且每个月的行数都在
我正在尝试编写一个正则表达式,允许输入以分钟、秒、十分之一和百分之一为单位的时间。我遇到的问题是,还应该允许用户输入仅秒和十分之一或秒、十分之一和百分之一的时间。变化如下: 分:秒:日分:秒:日毫米:
我想知道输入“+1”是什么意思 scanf("%s", ss+1) 其中 ss 是字符串输入。 我正在解决 codechef 上的一个问题,当我尝试阅读其他一些解决方案以了解其他可能的解决方案/方法时
我想验证 jquery 函数接收的某个字符串。 这是我到目前为止所做的 var duration=$('#duration').val(); if(//string validation?) {
Porter Stemmer algorithm 的意义何在?是否有将 SS 转换为 SS 的规则? 最佳答案 假设规则 SS->SS 不在算法中。然后像 caress 这样的词根本不会被识别,而且算
有谁知道,是否可以在 mpv.conf 中设置包括毫秒在内的默认显示时间格式? 现在我需要点击时间切换到毫秒,因为手册中的选项 ,,timems'' https://mpv.io/manual/mas
我有一个按以下方式计算的变量 currTime: long currTime = System.currentTimeMillis() - start; //where start is the st
我正在尝试编写将秒数转换为以下格式的逻辑: HH:MM:SS:MS,其中 MS 为毫秒 HH:MM:SS;F,其中 F 是帧 (不仅仅是 HH:MM:SS,因此这个问题与 Stackoverflow
我正在使用以下代码以“dd/MM/yyyy HH:mm:ss.SS”格式获取日期。 import java.text.SimpleDateFormat; import java.uti
我有一天中每一分钟的数据点: import numpy as np data = np.random.random(1440,) # I can represent minutes as intege
这是查询的工作版本。我只需要用 AS 保存新值。谢谢 Andy。 $Wednesday = mysqli_query($conn, "SELECT *,TIME_FORMAT(class_start,
我有下表没有时区的时间戳(6) 2000/01/01 0:00:00 2000/01/01 10:00:00 2000/01/01 04:00:00 我想得到hh:mm:ss我想要的结果如下 0:00
我是一名优秀的程序员,十分优秀!