Sponsored Content
Top Forums Shell Programming and Scripting Calculating start and end of UK summertime Post 302517788 by rbatte1 on Wednesday 27th of April 2011 07:31:01 PM
Old 04-27-2011
Well British Summer Time is defined as starting on the last Sunday of March and ending on the last Sunday of October. Our timezone setting is therefore explicitly set to:-
Code:
GMT0BST,M3.5.0,M10.5.0

GMT & Britain, of course, being the world standard for time - and quite right too.

One way to get the date would be like this:-
Code:
#!/bin/ksh

read YYYY?"Please enter the year required: "
cal 3 $YYYY|grep -v "^$"|tail -1|read BST_start rest
cal 10 $YYYY|grep -v "^$"|tail -1|read BST_end rest

echo "BST starts on $BST_start/3/$YYYY and ends on $BST_end/10/$YYYY"



Does that help?




Robin
Liverpool/Blackburn
UK - as if you couldn't guess.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extract a particular start and end pattern from a line

hi In the foll example the whole text in a single line.... i want to extract text from IPTel to RTCPBase.h. want to use this acrooss the whole file Updated: IPTel\platform\core\include\RTCPBase.h \main\MWS2051_Sablime_Int\1... (7 Replies)
Discussion started by: manish205
7 Replies

2. UNIX for Advanced & Expert Users

Complete dump from start to the end

Hi all... I was accidentally wipe off my iphone and lost all the data in it:(. So I tried to use dd to create an image from iphone and ssh to the Mac by using: dd if=/dev/disk | ssh user@MacIP of='image.img' Then I mount this image on Mac/Windows and run recovery software because most of the... (1 Reply)
Discussion started by: seraphc
1 Replies

3. Shell Programming and Scripting

String as both start and end anchors in awk

Not sure if the title of this thread makes sense, but hopefully my explanation will. I'm using awk to print some stats from an apache accesslog. I would like to specify the regexp condition where only the two root pages of "index.html" and "/" are counted in my results. What I can't figure out... (3 Replies)
Discussion started by: picassolsus
3 Replies

4. Shell Programming and Scripting

searching between start and end time

Hello All, Below mentioned is my log file. I want to make a script which ask for start time and then end time and then search particular word between those lines. Like start time:2 end time: 4 and then search all values starting from cell 84 between this time. Please Help ... (2 Replies)
Discussion started by: wakhan
2 Replies

5. Shell Programming and Scripting

Perl regex using /START/../END/

I need help with perl code. I have a data file with lots of data example: data.txt file START DATA1 sjdfh kjhdf DATA2 sdkjfhk jds dshfgdf ... Around 20 - 30 lines END LDDDD awdkjasd a sdkahgdk jasdh SOME CRAP Some EMPTY lines etc START DATA1 sjdfh kjhdf DATA2 sdkjfhk jds... (2 Replies)
Discussion started by: chakrapani
2 Replies

6. Programming

Returning start/end indices

I have an array of distances and a len, for example len = 323 dist = I want to calculate the start and end index values around each distance in the array with a length of len from it. Values in dist are stored in ascending order. (4 Replies)
Discussion started by: kristinu
4 Replies

7. Shell Programming and Scripting

Remove lines between the start string and end string including start and end string Python

Hi, I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Discussion started by: Dabheeruz
1 Replies

8. Shell Programming and Scripting

How can I search with start and end criteria?

Hello I'm using cygwin and wouldlike extract information from an xml file according specific values, but don't know how. Let's say in a file content looks like this: <tab> SURNAME=Mustermann NAME=Max CUSTOMER SINCE= 18.01.2000 ADDRESS=Birmingham ... (2 Replies)
Discussion started by: witchblade
2 Replies

9. Shell Programming and Scripting

Retrieving sequences corresponding to start and end position

Hi all, I have a fasta file of a reference sequnce, I will like to retrieve sequences corresponding to a list of start and end position in another file >my_ref_seq GCCCTATAAGGGCAGAAGCTTGTCCTTCTTGTGCCAGTTATGACGTTTGTCCTAACTGCACATCTGGTAG... (4 Replies)
Discussion started by: Ibk
4 Replies

10. UNIX for Beginners Questions & Answers

Splitting week start date and end date based on custom period start dates

Below are my custom period start and end dates based on a calender, these dates are placed in a file, for each period i need to split into three weeks for each period row, example is given below. Could you please help out to achieve solution through shell script.. File content: ... (2 Replies)
Discussion started by: nani2019
2 Replies
IDATE(1)							   User Commands							  IDATE(1)

NAME
ical - A Hijri/Islamic calendar (and converter) SYNOPSIS
ical [--gregorian yyyymmdd] [--hijri yyyymmdd] [--umm_alqura] [--fixed_view] [--dual] [--help] DESCRIPTION
The ical program is a Hijri/Islamic calendar displayer. It utilizes and includes a Gregorian to Hijri (and vice-versa) date converter. The application uses and offers multiple calculation methods with not all of them agreeing at all times. The reason for this multiplicity is due to not having one agreed upon method and so various entities develop and advocate their calculations. ical is able to comprehend and calculate both pre-epoch or pre-Hijrah, denoted as "B.H", as well as post-epoch or post-Hijrah, denoted as "A.H", dates. ical also utilizes Gregorian's pre-epoch "B.C" and post-epoch "A.D" dates and notes them per its output. When entering pre- epoch years, negative numbers ought to be utilized. ical when run without any command-line options uses the host machine's Gregorian date and converts it to Hijri to display that month's view. Entries enclosed by [] denote exact day specified. OPTIONS
ical follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of all options is noted below: -h, --help Show summary of options -g, --gregorian yyyymmdd Specify the Gregorian date to be converted where 'y' stands for year, 'm' for month and 'd' for day -hi, --hijri yyyymmdd Specify the Hijri date to be converted where 'y' stands for year, 'm' for month and 'd' for day -u, --umm_alqura Specify to use the Umm Al-Qura calculation method (used mostly in Saudi Arabia) -f, --fixed_view Show a fixed week view (ie. start on Sun and end on Sat) else default to showing the preferred week view of the resulting calendar (Gregorian starts on Sunday, Hijri starts on Saturday) -d, --dual Show both converstion from and to calendar months simultaneously BACKGROUND
The Hijri calendar is used in most of the Arab world and is the symbolic calendar of the Islamic faithed worldwide. This calendar is known as the "Hijri" (based on the word "Hijrah" - denoting migration in Arabic) to signal Prophet Mohammed's (PBUH) migration from Makkah to Medinah on Thursday, July 15, 622 AD (Julian). The Islamic Hijri calendar is strictly lunar (ie. moon-based) with twelve lunar months which do not correspond or track their solar coun- terparts (the Gregorian calendar is a solar or sun-based calendar). Lunar years and thus Hijri years are, on average, about 354 days long resulting in a Hijri year being roughly about 11 days shorter than its Gregorian counterpart. There is much discussion and confusion regarding how best to track the Hijri calendar. A great deal of that confusion is based on the fact that many relay on a human moon sighting to denote the start (or end) of a month (each month of the Hijri calendar starts when a new moon's crescent is observed or is made visible at sunset) as opposed to using an empirical mathematic certainty. The methods presented in this application and its underlying ITL library are strictly arithmetic in nature and do NOT take moon-phases into consideration (in short, observational approximation is not used). LIMITATIONS
There is currently no Umm Al-Qura support. REPORTING BUGS
Report bugs on the web using http://bugs.arabeyes.org AUTHOR
Written by Nadim Shaikli as part of the Arabeyes.org project. COPYRIGHT
ical is subject to the GNU General Public License (GPL). Copyright (C) 2005, Arabeyes, Nadim Shaikli. SEE ALSO
The ITL (Islamic Tools Library). It is the underlying requirement for ical to function. The ITL library was created and is hosted at www.arabeyes.org. ical January 05, 2005 IDATE(1)
All times are GMT -4. The time now is 07:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy