SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-07-16 15:50:15

chameleon
UK #! Guy
From: Luxembourg
Registered: 2009-01-13
Posts: 719
Website

English Time

#!/bin/sh
# DC's english time 07/07/09
#
# find current time
t_hr=$(date +%-I)
#echo $t_hr
t_min=$(date +%-M)
#echo $t_min
#t_hr=9 #tester
#t_min=17 #tester

# is it time to ONE ( the only wierd case)
if [ $t_hr -eq 12 ] && [ $t_min -gt 32 ] ;then
	# what minute is it
	case $t_min in
	33|34|35|36|37)
	echo Twenty-Five to One ;;
	38|39|40|41|42)
	echo Twenty to One ;;
	43|44|45|46|47)
	echo Quarter to One ;;
	48|49|50|51|52)
	echo Ten to One ;;
	53|54|55|56|57|58|59)
	echo Five to One ;;
	58|59)
	echo nearly One "o'clock"
	esac
exit
fi
#echo $t_hr
#add one hour for the "to" hour
if [ $t_min -gt 32 ] ; then
t_hr=$(($t_hr + 1)) # override t_hr 
fi
#echo $t_hr

# find out what hour it is and change into text
case $t_hr in
0)
t_hr_text=midnight ;;
1)
t_hr_text=One ;;
2)
t_hr_text=Two ;;
3)
t_hr_text=Three ;;
4)
t_hr_text=Four ;;
5)
t_hr_text=Five ;;
6)
t_hr_text=Six ;;
7)
t_hr_text=Seven ;;
8)
t_hr_text=Eight ;;
9)
t_hr_text=Nine ;;
10)
t_hr_text=Ten ;;
11)
t_hr_text=Eleven ;;
12)
t_hr_text=Twelve ;;
esac

# what minute is it
case $t_min in
0|1|2)
echo $t_hr_text "o'clock";;
3|4|5|6|7)
echo  Five past $t_hr_text ;;
8|9|10|11|12)
echo Ten past $t_hr_text ;;
13|14|15|16|17)
echo Quarter past $t_hr_text ;;
18|19|20|21|22)
echo Twenty past $t_hr_text ;;
23|24|25|26|27)
echo Twenty-Five past $t_hr_text ;;
28|29|30|31|32)
echo Half past $t_hr_text ;;
33|34|35|36|37)
echo Twenty-Five to $t_hr_text ;;
38|39|40|41|42)
echo Twenty to $t_hr_text ;;
43|44|45|46|47)
echo Quarter to $t_hr_text ;;
48|49|50|51|52)
echo Ten to $t_hr_text ;;
53|54|55|56|57)
echo Five to $t_hr_text ;;
58|59)
echo nearly $t_hr_text "o'clock";;
esac

Last edited by chameleon (2014-07-16 15:54:05)

Offline

Be excellent to each other!

#2 2014-07-16 16:50:55

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: English Time

Offline

#3 2014-07-16 16:56:20

chameleon
UK #! Guy
From: Luxembourg
Registered: 2009-01-13
Posts: 719
Website

Re: English Time

Last edited by chameleon (2014-07-16 17:00:40)

Offline

#4 2014-07-16 17:47:12

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: English Time

 16 Jul 14 | 14:40:23 ~
    $ talktime
Twenty to Three
 
 16 Jul 14 | 14:40:29 ~
    $ 

Offline

#5 2014-07-16 18:32:34

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: English Time

@both of you

Neat clocks - I like them smile

Last edited by damo (2014-07-16 18:33:05)

Offline

#6 2014-07-16 18:55:25

chameleon
UK #! Guy
From: Luxembourg
Registered: 2009-01-13
Posts: 719
Website

Re: English Time

@Sector11
Thanks for the wordclock.sh wink
I might use this in my distrolette cool

Offline

#7 2014-07-16 19:18:28

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: English Time

Offline

#8 2014-07-16 19:23:05

chameleon
UK #! Guy
From: Luxembourg
Registered: 2009-01-13
Posts: 719
Website

Re: English Time

@Sector11
Some cool stuff there...I will log them...thanks  wink

Offline

#9 2014-07-16 21:00:44

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: English Time

Offline

#10 2014-07-16 23:27:43

chameleon
UK #! Guy
From: Luxembourg
Registered: 2009-01-13
Posts: 719
Website

Re: English Time

Offline

#11 2014-07-16 23:34:03

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: English Time

Offline

#12 2014-07-16 23:41:16

chameleon
UK #! Guy
From: Luxembourg
Registered: 2009-01-13
Posts: 719
Website

Re: English Time

@damo
Sorry I don't understand your comment sad
What is a boo boo?

Last edited by chameleon (2014-07-16 23:46:47)

Offline

#13 2014-07-16 23:52:02

porkpiehat
#! Die Hard
Registered: 2012-10-02
Posts: 1,007

Re: English Time

Last edited by porkpiehat (2014-07-17 01:44:11)

Offline

#14 2014-07-16 23:55:24

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: English Time

Might be useful for people visting England to understand English time 

Offline

#15 2014-07-17 00:30:43

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: English Time

Offline

#16 2014-07-17 02:20:20

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: English Time

Offline

#17 2014-07-17 09:41:22

chameleon
UK #! Guy
From: Luxembourg
Registered: 2009-01-13
Posts: 719
Website

Re: English Time

Oops sorry all...must be old age setting in yikes
@Alad forgive me...I don't know what happened there ops
@Sector11 Thanks for the 'boo boo' explanation  wink

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: bleh

Debian Logo