shell获取日期(昨天,明天,上月,下月)
今天
sh-4.1$ echo `date +%Y-%m-%d`
2016-08-17 昨天
sh-4.1$ echo `date -d "last day" +%Y-%m-%d`
2016-08-16 明天
sh-4.1$ echo `date -d "next day" +%Y-%m-%d`
2016-08-18 本月
sh-4.1$ echo `date +%Y-%m`
2016-08 下一月
sh-4.1$ echo `date -d "last month" +%Y-%m`
2016-07 上一月
sh-4.1$ echo `date -d "next month" +%Y-%m`
2016-09
shell获取日期(昨天,明天,上月,下月)的更多相关文章
- shell获取今天、明天、昨天、n天、周、月、年日期
1.获取今天日期 $ date -d now +%Y-%m-%d 或者$ date +%F 1 2 2.获取明天日期 $ date -d next-day +%Y-%m-%d$ date - ...
- java获取日期 昨天 今天 明天的日期
Date date=new Date();//取时间 Calendar calendar = new GregorianCalendar(); calendar.setTime(date); cale ...
- linux中用shell获取昨天、明天或多天前的日期
linux中用shell获取昨天.明天或多天前的日期 时间 -- :: BlogJava-专家区 原文 http://www.blogjava.net/xzclog/archive/2015/12/0 ...
- js获取日期:昨天今天和明天、后天
<html> <head> <meta http-equiv="Content-Type" content="textml; charset ...
- js获取日期实例之昨天今天和明天、后天
本文介绍了js获取日期的方法,可以获取前天.昨天.今天.明天.后天. 代码: <html> <head> <meta http-equiv="Content-T ...
- js获取日期:昨天今天和明天、后天 [转贴记录]
<html> <head> <meta http-equiv="Content-Type" content="textml; charset ...
- js获取日期:前天、昨天、今天、明天、后天
前天,昨天,今天,明天,后天 <html> <head> <meta http-equiv="Content-Type" content=" ...
- linux中用shell获取时间,日期
linux中用shell获取昨天.明天或多天前的日期:在Linux中对man date -d 参数说的比较模糊,以下举例进一步说明:# -d, --date=STRING display time d ...
- Shell获取格式化日期
Shell获取格式化日期 shell date 获取昨天日期 使用date -d 选项: date +"%Y%m%d" -d "+n days" 今天的后n天日 ...
随机推荐
- telnet简单操作 模拟请求
telnet简单操作 模拟请求 一: 二: 三: 按照以上操作即可!
- CodedDFS日志配置
本文根据Log4j的配置属性,编写了用于记录BMBR编码的日志 author: zyumeng Blog: [url] http://www.cnblogs.com/zyumeng/ [/url] 利 ...
- Destoon后台修改公司会员资料信息的必填项限制修改
/template/default/member/edit.htm module\member\admin\template\member_edit.tpl.php module\member\adm ...
- csv内存流文件流
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Tex ...
- 学习微信小程序之css17clearfix原理
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- xcode教程,MAC常用命令
Vmware中为Mac Os安装vmtools 开机后,在Finder中就可以找到Darwin.iso,进行安装. 附件:vmtools for macos下载地址 https://softwareu ...
- cf509B Painting Pebbles
B. Painting Pebbles time limit per test 1 second memory limit per test 256 megabytes input standard ...
- 让PV10000+的秘诀
原文地址:http://www.phonegap100.com/article-410-1.html 让PV10000+的秘诀 2015-5-4 21:49| 发布者: admin| 查看: 122| ...
- SRM 583 DIV1
A 裸最短路. class TravelOnMars { public: int minTimes(vector <int>, int, int); }; vector<int> ...
- Python进阶(面向对象编程基础)(四)
1.方法也是属性 我们在 class 中定义的实例方法其实也是属性,它实际上是一个函数对象: class Person(object): def __init__(self, name, score) ...