$ date +"FORMAT"

now=$(date +"%Y-%m-%d-%S")
filename="my_program.$now.log"
# example filename: my_program.2012-01-23-47.log
now=$(date +"%Y.%m.%d.%S.%N")
filename="my_program.$now.log"
# example filename: my_program.2013.01.23.44.364617000.log
now=$(date +"%s")
filename="my_program.$now.log"
# example filename: my_program.1358995092.log

【转】How to append current date and timestamp to filename in shell script的更多相关文章

  1. Vertica的date与timestamp数据类型,to_date()与to_timestamp()函数区别

    实验环境:3节点,RHEL6.4 + Vertica 7.0.1 实验目的:了解Vertica数据库的date与timestamp数据类型,to_date()与to_timestamp()函数区别   ...

  2. Oracle date 和 timestamp 区别

    1.DATE数据类型 这个数据类型我们实在是太熟悉了,当我们需要表示日期和时间的话都会想到date类型.它可以存储月,年,日,世纪,时,分和秒.它典型地用来表示什么时候事情已经发生或将要发生.    ...

  3. linux下对date和timestamp的互转

    1. date 到 timestamp: $ date -d '2009-12-01 23:20' +%s 12596808002. timestamp 到 date$ date -d '1970-0 ...

  4. Java:String和Date、Timestamp之间的转

    Java:String和Date.Timestamp之间的转 一.String与Date(java.util.Date)互转 1.1 String -> Date String dateStr  ...

  5. mysql建库DATETIME、DATE 和 TIMESTAMP区别

    http://blog.sina.com.cn/s/blog_5f7b8c2c0100tf6t.html     DATETIME.DATE 和 TIMESTAMP 类型是相似的.本篇描述了它们的特性 ...

  6. 转 数据库中的 date datetime timestamp的区别

    转 数据库中的 date datetime timestamp的区别 DATETIME, DATE和TIMESTAMP类型是相关的.本文描述他们的特征,他们是如何类似的而又不同的. DATETIME类 ...

  7. String、Date和Timestamp的互转

    begin 2018年8月17日19:09:49 String.Date和Timestamp的互转 String和Date的互转 关于String和Date的互转,在java8后会有不同.因为java ...

  8. Java – How to add days to current date

    1. Calendar.add Example to add 1 year, 1 month, 1 day, 1 hour, 1 minute and 1 second to the current ...

  9. Java – How to get current date time

    Java – How to get current date time 1. Code SnippetsFor java.util.Date, just create a new Date() Dat ...

随机推荐

  1. 关于CSS的table-layout属性的用法详解

    前言: 今天来和大家详细说一下table-layout属性的用法. /*eg:设置表格布局算法*/ table{ table-layout:fixed; } ***本文关键词:table-layout ...

  2. deeplearning.ai 人工智能行业大师访谈 Andrej Karpathy 听课笔记

    1. 本科的时候在多伦多大学上Geoffrey Hinton的课,在MNIST数字数据集上训练受限玻尔兹曼机,觉得很有趣.后来在UBC读硕士,上了另一门机器学习的课,那是他第一次深入了解神经网络的相关 ...

  3. cs231n spring 2017 lecture8 Deep Learning Networks 听课笔记

    1. CPU vs. GPU: CPU核心少(几个),更擅长串行任务.GPU有很多核心(几千个),每一个核都弱,有自己的内存(几个G),很适合并行任务.GPU最典型的应用是矩阵运算. GPU编程:1) ...

  4. ZOj 3466 The Hive II

    There is a hive in the village. Like this. There are 8 columns(from A to H) in this hive. Different ...

  5. 【NOI2014】魔法森林

    为了得到书法大家的真传,小E同学下定决心去拜访住在魔法森林中的隐士.魔法森林可以被看成一个包含个N节点M条边的无向图,节点标号为 1…n1…n,边标号为1…m1…m.初始时小E同学在 11 号节点,隐 ...

  6. Codeforces 791A Bear and Big Brother(暴力枚举,模拟)

    A. Bear and Big Brother time limit per test:1 second memory limit per test:256 megabytes input:stand ...

  7. Codeforces 833D Red-black Cobweb【树分治】

    D. Red-black Cobweb time limit per test:6 seconds memory limit per test:256 megabytes input:standard ...

  8. 【android studio】 gradle配置成本地离线zip包

    http://blog.csdn.net/jingleye/article/details/52689260       关键词:distributionUrl修改成本地路径,android stud ...

  9. oracle数据泵备份与恢复库

    假如  导出库的用户名是tiger,密码是1  导入到用户名是scott,密码是1 备份库 expdp tiger/1@orcl dumpfile=expdp.dmp DIRECTORY=dpdata ...

  10. SAX解析原理示意

    SAX解析原理示意