构造当月特定日期的日期并将其转换为纪元

时间:2015-06-21 14:14:08

标签: date converter epoch

我需要当月第4天的时代。

我有这个:

START_DT=$(date +"%Y-%m-04 00:00:00")
START_DT_TS=$(date -d "$START_DT" +%s)

预计输出为1433368800。

我如何在单行上实现这一目标?

1 个答案:

答案 0 :(得分:0)

尝试backqoutes方法

select top 100
SUBSTRING(t.text, (s.statement_start_offset/2)+1,
((CASE s.statement_end_offset
WHEN -1 THEN DATALENGTH(t.text)
ELSE s.statement_end_offset
END - s.statement_start_offset)/2) + 1) as statement_text,
t.text,
s.total_logical_reads, 
s.total_logical_reads / s.execution_count as avg_logical_reads,
s.total_worker_time, 
s.total_worker_time / s.execution_count as avg_worker_time,
s.execution_count,
creation_time,
last_execution_time,
cast(p.query_plan as xml) as query_plan
from sys.dm_exec_query_stats s
cross apply sys.dm_exec_sql_text (sql_handle) t
cross apply sys.dm_exec_text_query_plan (plan_handle, statement_start_offset, statement_end_offset) p
where t.text like '%VeryBigChildTable%'
-- this way you'll get everything related to the big table
order by s.total_logical_reads desc