date 輸出每個月的日期? - Linux

Lily avatar
By Lily
at 2011-05-26T09:45

Table of Contents

請教一下,我知道 date 可以知道目前的時間日期以及前後天等這類的資訊,
不知道它是否可以我給定它譬如: 2011年 2 月份,它會回傳給我 28 天;
給他 2008 年 2 月,他會回傳給我 29 天。不知道是否可以實現?謝謝!

--
Tags: Linux

All Comments

Agnes avatar
By Agnes
at 2011-05-29T00:22
寫個perl/python/php script來做.或者用c寫一個很快
Andy avatar
By Andy
at 2011-05-30T22:50
真的可以耶... date -d"2011-03-01 yesterday" +%d
Andy avatar
By Andy
at 2011-06-04T13:32
以下為推文3行c程式,存成 md.c 然後 cc -o md md.c 即可
Doris avatar
By Doris
at 2011-06-06T11:32
char*s="_303232332323";main(int c,char*v[]){int y=atoi
(v[1]);int m=atoi(v[2]);printf("%d",(m==2)*((y%400==0)
-(y%100==0)+(y%4==0))+s[m]-20);}
Anonymous avatar
By Anonymous
at 2011-06-11T07:36
md 是raid專有名詞,檔名換成mds,使用方式 mds 2008 2
Ina avatar
By Ina
at 2011-06-15T18:34
date -d"2011-03-01 yesterday" +%d 真是讃!感謝!

ubuntu 無法啟動

Carolina Franco avatar
By Carolina Franco
at 2011-05-26T07:14
※ 引述《jnews (jjnews)》之銘言: : 更新之後就無法啟動 : 啟動出現像修復模式的選項 : 隨便選一個之後出現以下訊息 : mount: mounting /dev on /root/dev failed: No such file or directory : mount: mounting ...

Ubuntu 11.04 怎麼把螢幕反白

Catherine avatar
By Catherine
at 2011-05-26T04:31
不好意思標題下的不好, 實在是不知道這個問題怎麼下標題。 之前用Ubuntu 10.04的時候只要按 Super(windows鍵) + M 就可以把整個螢幕反白(白底變黑底之類的), 可是最近升級到11.04發現這個功能不見了, Google了一下也沒有相關的資料, 所以想請教板上的前輩這個功能 ...

ubuntu 11.04 光碟安裝問題

Erin avatar
By Erin
at 2011-05-26T03:06
我再用光碟安裝ubuntu 11.04 時出現下面的字之後就停住不動了 SYSLINUX 3.85 2010-02-20 CBIOS Copyright (c) 1994-2010 H. Peter Anvin et al No DEFAULT or UI configuration directive f ...

ubuntu 無法啟動

Emma avatar
By Emma
at 2011-05-25T22:07
更新之後就無法啟動 啟動出現像修復模式的選項 隨便選一個之後出現以下訊息 mount: mounting /dev on /root/dev failed: No such file or directory mount: mounting / sys/ on root/sys failed: No s ...

Fedora15 裝了之後無法與Win7多重開機

Blanche avatar
By Blanche
at 2011-05-25T22:04
因為fedora 15剛出覺得很新奇 所以想裝來試試看 網路上找了篇Fedora14和win7的安裝心得 他是說F15 裝了之後不會在開機選單出現 要另外用easyBCD把Linux叫出來 我fedora 15安裝時是先把WIN7切割50GB之後刪除磁碟區 保留空白 之後Fedora安裝時使用and ...