1.A:__day is that day? B:it's Sunday.I have a nice daybirthday ___on that day.__you come

Presidents’ Day - Holidays -
Article Details:
Presidents’ Day
Website Name
Year Published
Presidents’ Day
/topics/holidays/presidents-day
Access Date
June 07, 2015
A+E Networks
Presidents& Day is an American holiday celebrated on the third Monday in February. Originally established in 1885 in recognition of President George Washington, it is still officially called &Washington&s Birthday& by the federal government. Traditionally celebrated on February 22&Washington&s actual day of birth&the holiday became popularly known as Presidents& Day after it was moved as part of 1971&s Uniform Monday Holiday Act, an attempt to create more three-day weekends for the nation&s workers. While several states still have individual holidays honoring the birthdays of Washington, Abraham Lincoln and other figures, Presidents& Day is now popularly viewed as a day to celebrate all U.S. presidents past and present.
Advertisement
The story of Presidents’ Day date begins in 1800. Following President George Washington’s death in 1799, his February 22 birthday became a perennial day of remembrance. At the time,
was venerated as the most important figure in American history, and events like the 1832 centennial of his birth and the start of construction of the Washington Monument in 1848 were cause for national celebration.
Did You Know?
President's Day never falls on the actual birthday of any American president. Four chief executives—George Washington, William Henry Harrison, Abraham Lincoln and Ronald Reagan_were born in February, but their birthdays all come either too early or late to coincide with Presidents’ Day, which is always celebrated on the third Monday of the month.While Washington’s Birthday was an unofficial observance for most of the 1800s, it was not until the late 1870s that it became a federal holiday. Senator Steven Wallace Dorsey of
was the first to propose the measure, and in 1879 President
signed it into law. The holiday initially only applied to the District of Columbia, but in 1885 it was expanded to the whole country. At the time, Washington’s Birthday joined four other nationally recognized federal bank holidays— Day, New Year’s Day, Independence Day and Thanksgiving—and was the first to celebrate the life of an individual American.
Day, signed into law in 1983, would be the second.
The shift from Washington’s Birthday to Presidents’ Day began in the late 1960s when Congress proposed a measure known as the Uniform Monday Holiday Act. Championed by Senator Robert McClory of , this law sought to shift the celebration of several federal holidays from specific dates to a series of predetermined Mondays. The proposed change was seen by many as a novel way to create more three-day weekends for the nation’s workers, and it was believed that ensuring holidays always fell on the same weekday would reduce employee absenteeism. While some argued that shifting holidays from their original dates would cheapen their meaning, the bill also had widespread support from both the private sector and labor unions and was seen as a surefire way to bolster retail sales.
The Uniform Monday Holiday Act also included a provision to combine the celebration of Washington’s Birthday with Abraham Lincoln’s, which fell on the proximate date of February 12. Lincoln’s Birthday had long been a state holiday in places like Illinois, and many supported joining the two days as a way of giving equal recognition to two of America’s most famous statesmen.
McClory was among the measure’s major proponents, and he even floated the idea of renaming the holiday “President’s Day.” This proved to be a point of contention for lawmakers from George Washington’s home state of , and the proposal was eventually dropped. Nevertheless, the main piece of the Uniform Monday Holiday Act passed in 1968 and officially took effect in 1971 following an executive order from President Richard Nixon. Washington’s Birthday was then shifted from the fixed date of February 22 to the third Monday of February. ,
were also moved from their traditionally designated dates. (As a result of widespread criticism, in 1980 Veterans’ Day was returned to its original November 11 date.)
While Nixon’s order plainly called the newly placed holiday Washington’s Birthday, it was not long before the shift to Presidents’ Day began. The move away from February 22 led many to believe that the new date was intended to honor both Washington and , as it now fell between their two birthdays. Marketers soon jumped at the opportunity to play up the three-day weekend with sales, and “Presidents’ Day” bargains were advertised at stores around the country.
By the mid-1980s Washington’s Birthday was known to many Americans as Presidents’ Day. This shift had solidified in the early 2000s, by which time as many as half the 50 states had changed the holiday’s name to Presidents’ Day on their calendars. Some states have even chosen to customize the holiday by adding new figures to the celebration. Arkansas, for instance, celebrates Washington as well as civil rights activist Daisy Gatson Bates. , meanwhile, uses Presidents’ Day to commemorate Washington and
(who was born in April).
Washington and Lincoln still remain the two most recognized leaders, but Presidents’ Day is now popularly seen as a day to recognize the lives and achievements of all of America’s chief executives. Some lawmakers have objected to this view, arguing that grouping
and Abraham Lincoln together with less successful presidents minimizes their legacies. Congressional measures to restore Washington and Lincoln’s individual birthdays were proposed during the early 2000s, but all failed to gain much attention. For its part, the federal government has held fast to the original incarnation of the holiday as a celebration of the country’s first president. The third Monday in February is still listed on official calendars as Washington’s Birthday.
Like Independence Day, Presidents’ Day is traditionally viewed as a time of patriotic celebration and remembrance. In its original incarnation as Washington’s Birthday, the holiday gained special meaning during the difficulties of the Great Depression, when portraits of George Washington often graced the front pages of newspapers and magazines every February 22. In 1932 the date was used to reinstate the Purple Heart, a military decoration originally created by George Washington to honor soldiers killed or wounded while serving in the armed forces. Patriotic groups and the Boy Scouts of America also held celebrations on the day, and in 1938 some 5,000 people attended mass at Saint Patrick’s Cathedral in
City in honor of Washington.
In its modern form, Presidents’ Day is used by many patriotic and historical groups as a date for staging celebrations, reenactments and other events. A number of states also require that their public schools spend the days leading up to Presidents’ Day teaching students about the accomplishments of the presidents, often with a focus on the lives of Washington and Lincoln.
Fact Check We strive for accuracy and fairness. But if you see something that doesn't look right, !ISSUU - B2Day NOV 2014 by Barton Today
B2Day NOV 2014
B2Day NOV 2014
Full of news in Earls Barton, local advertisers and whats going in and around the village, including , Happy Birthday to Bernard 100yrs young, Cats Protection Bazaar and other Xmas Events, Wellingborough Rugby Club info, The Great British Bark off, Parish Council news and lots more!Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
I have a windows batch file that runs daily. Wish to log data into a file and want to rotate it (i.e. having at most the last 7 days worth of data).
Looked into the commands DATE and DELIMS - Cannot figure out a solution.
Is there a simple solution to create a file name that contains the day of the week i.e. 0 for monday etc.
Or do I have to resort to some better shell script.
28.7k93274
%DATE% is not your friend. Because %DATE% environment variable (or DATE command) return the current date using the Windows short date format that is fully (endlessly) customizable. One user may configure its system to return 07/06/2012 while another might peek Fri060712. It's a complete nightmare for a BAT programmer.
There are two solutions:
You may change the short date format to a recognizable format, (by changing the locale settings in the registry), access %DATE%, and then
restore it back to the user format
reg copy "HKCU\Control Panel\International" "HKCU\Control Panel\International-Temp" /f &nul
reg add "HKCU\Control Panel\International" /v sShortDate /d "ddd" /f &nul
set DOW=%DATE%
reg copy "HKCU\Control Panel\International-Temp" "HKCU\Control Panel\International" /f &nul
but this method has two problems:
it changes a global registry value for its purpouses, so it may interfere with other processes that at the very same time query the date in short date format, including itself if run simultaneously.
and it returns the three letter day of the week in the local language that may be different in different systems or different users.
use WMIC Win32_LocalTime, that returns the date in a convenient way to directly parse it with a FOR command.
FOR /F "skip=1" %%A IN ('WMIC Path Win32_LocalTime Get DayOfWeek' ) DO (
set DOW=%%A
this is the method I recommend.
12.6k23150
REM GET DAY OF WEEK VIA DATE TO JULIAN DAY NUMBER CONVERSION
REM ANTONIO PEREZ AYALA
REM GET MONTH, DAY, YEAR VALUES AND ELIMINATE LEFT ZEROS
FOR /F "TOKENS=1-3 DELIMS=/" %%A IN ("%DATE%") DO SET /A MM=10%%A %% 100, DD=10%%B %% 100, YY=%%C
REM CALCULATE JULIAN DAY NUMBER, THEN DAY OF WEEK
IF %MM% LSS 3 SET /A MM+=12, YY-=1
SET /A A=YY/100, B=A/4, C=2-A+B, E=36525*(YY+, F=306*(MM+1)/10, JDN=C+DD+E+F-1524
SET /A DOW=(JDN+1)%%7
DOW is 0 for Sunday, 1 for Monday, etc.
25.1k31841
This turned out way more complex then I first suspected, and I guess that's what intrigued me, I searched every where and all the methods given wouldnt work on Windows 7.
So I have an alternate solution which uses a Visual Basic Script.
The batch creates and executes the script(DayOfWeek.vbs), assigns the scripts output (Monday, Tuesday etc) to a variable (dow), the variable is then checked and another variable (dpwnum) assigned with the days number, afterwards the VBS is deleted hope it helps:
REM Create VBS that will get day of week in same directory as batch
echo wscript.echo WeekdayName(Weekday(Date))&&DayOfWeek.vbs
REM Cycle through output to get day of week i.e monday,tuesday etc
for /f "delims=" %%a in ('cscript /nologo DayOfWeek.vbs') do @set dow=%%a
REM delete vbs
del DayOfWeek.vbs
REM Used for testing outputs days name
echo %dow%
REM Case of the days name is important must have a capital letter at start
REM Check days name and assign value depending
IF %dow%==Monday set downum=0
IF %dow%==Tuesday set downum=1
IF %dow%==Wednesday set downum=2
IF %dow%==Thursday set downum=3
IF %dow%==Friday set downum=4
IF %dow%==Saturday set downum=5
IF %dow%==Sunday set downum=6
REM print the days number 0-mon,1-tue ... 6-sun
echo %downum%
REM set a file name using day of week number
set myfile=%downum%.bak
echo %myfile%
Though I turned to VBS, It can be done in pure batch, took me a while to get it working and a lot of searching lol, but this seems to work:
SETLOCAL enabledelayedexpansion
SET /a count=0
FOR /F "skip=1" %%D IN ('wmic path win32_localtime get dayofweek') DO (
if "!count!" GTR "0" GOTO next
set dow=%%D
SET /a count+=1
echo %dow%
The only caveat for you on the above batch is that its day of weeks are from 1-7 and not 0-6
24.7k43581
few more ways:
1.Robocopy not available in XP but can be downloaded form with win 2003 resource tool kit .Also might depend on localization:
for /f "skip=8 tokens=2,3,4,5,6,7,8 delims=: " %%D in ('robocopy /l * \ \ /ns /nc /ndl /nfl /np /njh /XF * /XD *') do (
set "dow=%%D"
set "month=%%E"
set "day=%%F"
set "HH=%%G"
set "MM=%%H"
set "SS=%%I"
set "year=%%J"
echo Day of the week: %dow%
- works on every windows machine (but creates a small temp file).
Call :GetDate.Init
Rem :GetDate.Init should be called one time in the code before call to :Getdate
Call :GetDate
Echo weekday:%weekday%
:GetDate.Init
Set /A "jan=1,feb=2,mar=3,apr=4,may=5,jun=6,jul=7,aug=8,sep=9,oct=10,nov=11,dec=12"
Set /A "mon=1,tue=2,wed=3,thu=4,fri=5,sat=6,sun=7"
Echo .Set InfHeader=""
Echo .Set InfSectionOrder=""
Echo .Set InfFooter="%%2"
Echo .Set InfFooter1=""
Echo .Set InfFooter2=""
Echo .Set InfFooter3=""
Echo .Set InfFooter4=""
Echo .Set Cabinet="OFF"
Echo .Set Compress="OFF"
Echo .Set DoNotCopyFiles="ON"
Echo .Set RptFileName="NUL"
) &"%Temp%\~foo.ddf"
Set "tf=%Temp%\~%random%"
Makecab /D InfFileName="%tf%" /F "%Temp%\~foo.ddf" &NUL
For /F "usebackq tokens=1-7 delims=: " %%a In ("%tf%") Do (
Set /A "year=%%g,month=%%b,day=1%%c-100,weekday=%%a"
Set /A "hour=1%%d-100,minute=1%%e-100,second=1%%f-100")
Del "%tf%" &NUL 2&&1
3.W32TM - uses command switches introduced in Vista so will not work on windows 2003/XP:
call :w32dow day_ow
echo %day_ow%
:w32dow [RrnVar]
rem :: prints the day of the week
rem :: works on Vista and above
rem :: getting ansi date ( days passed from 1st jan 1601 ) , timer server hour and current hour
FOR /F "tokens=4,5 delims=:( " %%D in ('w32tm /stripchart /computer:localhost
/samples:1
/period:1 /dataonly /packetinfo^|find "Transmit Timestamp:" ') do (
set "ANSI_DATE=%%D"
"TIMESERVER_HOURS=%%E"
"LOCAL_HOURS=%TIME:~0,2%"
if "%TIMESERVER_HOURS:~0,1%0" EQU "00" set TIMESERVER_HOURS=%TIMESERVER_HOURS:~1,1%
if "%LOCAL_HOURS:~0,1%0" EQU "00" set LOCAL_HOURS=%LOCAL_HOURS:~1,1%
set /a OFFSET=TIMESERVER_HOURS-LOCAL_HOURS
rem :: day of the week will be the modulus of 7 of local ansi date +1
rem :: we need need +1 because Monday will be calculated as 0
1st jan 1601 was Monday
rem :: if abs(offset)&12 we are in different days with the time server
IF %OFFSET%0 GTR 120 set /a DOW=(ANSI_DATE+1)%%7+1
IF %OFFSET%0 LSS -120 set /a DOW=(ANSI_DATE-1)%%7+1
IF %OFFSET%0 LEQ 120 IF %OFFSET%0 GEQ -120 set /a DOW=ANSI_DATE%%7+1
rem echo Day of the week: %DOW%
endlocal & if "%~1" neq "" (set "%~1=%DOW%") else echo %DOW%
4..bat/jscript hybrid (must be saved as .bat):
@if (@x)==(@y) @end /***** jscript comment ******
%%d in ('cscript //E:JScript //nologo "%~f0"') do echo %%d
end comment *********/
WScript.Echo((new Date).getDay());
5..bat/vbscript hybrid
:sub echo(str) :end sub
'&nul 2&&1|| copy /Y %windir%\System32\doskey.exe '.exe &nul
'& for /f %%w in ('cscript /nologo /E:vbscript %~dpfn0') do echo day of the week %%w
'& del /q "'.exe" &nul 2&&1
'& exit /b
WScript.Echo Weekday(Date)
WScript.Quit
6.powershell can be downloaded from microsoft.Available by default in everything form win7 and above:
for /f %%d in ('"powershell (Get-Date).Day"') do set dow=%%d
echo day of the week : %dow%
7.WMIC already used as an answer but just want to have a full reference.
for /f "delims=" %%a in ('wmic path win32_localtime get dayofweek /format:list ') do for /f "delims=" %%d in ("%%a") do set %%d
echo day of the week : %dayofweek%
9.Selfcompiled jscript.net (must be saved as .bat):
@if (@X)==(@Y) @end /****** silent line that start jscript comment ******
::::::::::::::::::::::::::::::::::::
compile the script
::::::::::::::::::::::::::::::::::::
if exist "%~n0.exe" goto :skip_compilation
set "frm=%SystemRoot%\Microsoft.NET\Framework\"
:: searching the latest installed .net framework
for /f "tokens=* delims=" %%v in ('dir /b /s /a:d /o:-n "%SystemRoot%\Microsoft.NET\Framework\v*"') do (
if exist "%%v\jsc.exe" (
rem :: the javascript.net compiler
set "jsc=%%~dpsnfxv\jsc.exe"
goto :break_loop
echo jsc.exe not found && exit /b 0
:break_loop
call %jsc% /nologo /out:"%~n0.exe" "%~dpsfnx0"
::::::::::::::::::::::::::::::::::::
end of compilation
::::::::::::::::::::::::::::::::::::
:skip_compilation
"%~n0.exe"
****** end of jscript comment ******/
import System.IO;
var dt=DateTime.N
Console.WriteLine(dt.DayOfWeek);
17.1k42245
I thought that my first answer gives the correct day of week as a number between 0 and 6. However, because you had not indicated why this answer does not give the result you want, I can only guess the reason.
The Batch file below create a log file each day with a digit in the name, 0=Sunday, 1=Monday, etc... The program assume that echo %date% show the date in MM/DD/YYYY if this is not the case, just change the position of mm and dd variables in the for command.
for /F "tokens=1-3 delims=/" %%a in ("%date%") do set /A mm=10%%a %% 100, dd=10%%b %% 100, yy=%%c
if %mm% lss 3 set /A mm+=12, yy-=1
set /A a=yy/100, b=a/4, c=2-a+b, e=36525*(yy+, f=306*(mm+1)/10, dow=(c+dd+e+f-1523)%%7
echo Today log data & Day-%dow%.txt
If this is not what you want, please indicate the problem so I can fix it.
EDIT: The version below get date parts independent of locale settings:
for /F "skip=1 tokens=2-4 delims=(-/)" %%A in ('date ^& NUL') do (
for /F "tokens=1-3 delims=/" %%a in ("%date%") do (
set %%A=%%a
set %%B=%%b
set %%C=%%c
set /A mm=10%mm% %% 100, dd=10%dd% %% 100
if %mm% lss 3 set /A mm+=12, yy-=1
set /A a=yy/100, b=a/4, c=2-a+b, e=36525*(yy+, f=306*(mm+1)/10,
dow=(c+dd+e+f-1523)%%7
echo Today log data & Day-%dow%.txt
EDIT: The version below insert day of week as 3-letter short name:
for /F "skip=1 tokens=2-4 delims=(-/)" %%A in ('date ^& NUL') do (
for /F "tokens=1-3 delims=/" %%a in ("%date%") do (
set %%A=%%a
set %%B=%%b
set %%C=%%c
set /A mm=10%mm% %% 100, dd=10%dd% %% 100
if %mm% lss 3 set /A mm+=12, yy-=1
set /A a=yy/100, b=a/4, c=2-a+b, e=36525*(yy+, f=306*(mm+1)/10,
dow=(c+dd+e+f-1523)%%7 + 1
for /F "tokens=%dow%" %%a in ("Sun Mon Tue Wed Thu Fri Sat") do set dow=%%a
echo Today log data & Day-%dow%.txt
25.1k31841
Locale-dependent version:
In some environments, the following will extract the day name from the date:
set dayname=%date:~0,3%
It assumes that the day name is the first part of %date%.
Depending on the machine settings, though, the substring part (~0,3) would need to change.
A statement such as this would dump to a file with a three character day name:
set logfile=%date:~0,3%.log
echo some stuff & %logfile%
Locale-independent version: If you need it less dependent on the current machine's day format, another way of doing it would be to write a tiny application that prints the day of the week.
Then use the output of that program from the batch file.
For example, the following C application prints dayN where N=0..6.
#include &stdio.h&
#include &time.h&
int main( int argc, char* argv[] )
struct tm *
time( &curtime );
tmval = localtime( &curtime );
// print dayN.
Or use a switch statement and print
// the actual day name if you want
printf( "day%d", tmval-&tm_wday );
If the above were compiled and linked as myday.exe, then you could use it from a batch file like this:
for /f %%d in ('myday.exe') do set logfile=%%d.log
echo some stuff & %logfile%
I am in the US. I can run this code in Windows 7, Windows 2008 R2, Windows Server 2003, Windows XP (All OS's are current with Windows Updates and patches). All with short date setting without ddd (or dddd) (day of week).
for /f %%a in ('date /t') do set DAY=%%a
echo The Day Is: %DAY%
If today is Thursday, it would output "The Day Is: Thu".
This returns the day on all 4 Windows versions I have tested on. And only the day. When I changed my short date setup to be "ddd, M/d/yyyy", my output would show the day with a comma (e.g. Thu,) which tells me this code does use the short date format. But what also may be happening is that if the short date does not contain the day of week, it may look to the long date format which on all 4 machines I tested on, have dddd in the format.
I have this solution working for me:
Create a file named dayOfWeek.vbs in the same dir where the cmd file will go.
dayOfWeek.vbs contains a single line:
wscript.stdout.write weekdayname(weekday(date))
or, if you want day number instead of name:
wscript.stdout.write weekday(date)
The cmd file will have this line:
For /F %%A In ('CScript dayOfWeek.vbs //NoLogo') Do Set dayName=%%A
Now you can use variable dayName like:
robocopy c:\inetpub \\DCStorage1\Share1\WebServer\InetPub_%dayName% /S /XD history logs
Rem Remove the end comma and add /A to set for this line worked for me.
set /A a=yy/100, b=a/4, c=2-a+b, e=36525*(yy+, f=306*(mm+1)/10
This works for me
FOR /F "tokens=3" %%a in ('robocopy ^|find "Started"') DO SET TODAY=%%a
30.1k104358
If you can change format of short date in the PC to "ddd yyyy-MM-dd" (only first parameter 'ddd' is compulsory), then following command returns-
c:\&vol | date
The current date is: Mon
Then you can write you batch file -
vol | date | find /i "sun" & nul
if not errorlevel 1 goto SUN
vol | date | find /i "mon" & nul
if not errorlevel 1 goto MON
# write block for other week days
set fname="sun"
goto BACKUP
set fname="mon"
goto BACKUP
# write block for other week days
echo %fname%
This is not my work (well, I modified it slightly from the example), and it's late to the game, but this works on Server 2003
set daysofweek=Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday
for /F "skip=2 tokens=2-4 delims=," %%A in ('WMIC Path Win32_LocalTime Get DayOfWeek /Format:csv') do set daynumber=%%A
for /F "tokens=%daynumber% delims=," %%B in ("%daysofweek%") do set day=%%B
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled

我要回帖

更多关于 have a nice day 的文章

 

随机推荐