Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Changing First Day Of The Week? Post 302086867 by fowlerleftfoot on Monday 28th of August 2006 07:26:47 AM
Old 08-28-2006
Changing First Day Of The Week?

Hi All,
Our system is running on Solaris 8 and we are using US locale. By default the First Day Of Week is Sunday, is it possible for us to change it to Monday?
I have googled it but found very little of use.
THanks in advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Calculating the day of the week

Hi all, I would like to calculate the day of the week using a supplied date. i.e. 20011012 = Day 5. Any ideas? Many thanks, ligs (4 Replies)
Discussion started by: ligs
4 Replies

2. Programming

Function that gets the day of the week (0-6) ??

Hi , I am working at Unix system,using c lang. I need c fun which return the day of the week . For example : 0- Sunday. 1- Monday. .... 10x. (4 Replies)
Discussion started by: kamil
4 Replies

3. Shell Programming and Scripting

Yesterday's Day of week

I need o get yesterday's day of week but im not exactly sure. the actual name is what i want. I can do it with numbers but im not sure with words. (3 Replies)
Discussion started by: rcunn87
3 Replies

4. HP-UX

Get Day of Week from date

Hi All, I have date in string format 'YYYY-MM-DD'. I want to know day of the week for this date. Example. For '2005-08-21' my script should return '0' or Sunday For '2005-08-22' it should return '1' or Monday I want piece of code for HP-UX korn shell. Appreciate reply on this. (5 Replies)
Discussion started by: vpapaiya
5 Replies

5. Shell Programming and Scripting

Get day of week from cal

Hi all, I am trying to get dow from cal using below script #! /bin/bash YEAR=`echo $1 | cut -c 1-4` MONTH=`echo $1 | cut -c 5-6` DAY=`echo $1 | cut -c 7-8` for i in 1 2 3 4 5 6 7 do dayofweek=`cal $MONTH $YEAR | awk '$i == $DAY {printf("%s","$i")}'` echo $dayofweek... (4 Replies)
Discussion started by: bzylg
4 Replies

6. UNIX for Dummies Questions & Answers

Day of the week from a string

Hi All, I need to know how to derive the day of the week by passing the value in following format: Feb 28 2010 The output I'm expecting is Sunday or Sun. I know, I can use the following code to get the day of the week. date +%a But I want to pass the value as a string. Please help... (11 Replies)
Discussion started by: shash
11 Replies

7. AIX

aix...day of the week command

I have a ksh script that runs fine on Linux box but not on an AIX box. I am trying to determine what awk to use, using an "if" statement that says 'if today is Monday, do this else run the other awk statement'. here is my code... if then awk -vD=$(date -d '3 days ago' '+%Y%m%d1700')... (3 Replies)
Discussion started by: bds052189
3 Replies

8. HP-UX

Find Day of Week

In HP-UX the date command does not have the "-d" switch like some other *nixes do. I'm working a simple script to tell me, given the day, month and year what day of the week that falls on. Assuming valid day, month and year input (I'd perform quality checks on the input separately, but not... (5 Replies)
Discussion started by: rwuerth
5 Replies

9. UNIX for Dummies Questions & Answers

Sudoers for one day per week?

I have been volunteered by my boss to be the sysadmin for our production redhat server. He asked me to tighten the security to avoid mishaps like "rm -f *" that occured not long ago. Right now, we have 53 users sudo-ing into the machine and it is an audit nightmare. I am wondering if it... (15 Replies)
Discussion started by: alan
15 Replies

10. Shell Programming and Scripting

Get the week's day

Hi All, I have the below requirement , if i give the week number for ex 41 i need to get the date for Monday and thursday for this given week. my expected output is 13/10/2014 (Monday's date) and 16/10/2014 (Thursday's date) I am using GNU LINUX . Pls help me with your thoughts. Thanks in... (7 Replies)
Discussion started by: mohanalakshmi
7 Replies
clock(n)						       Tcl Built-In Commands							  clock(n)

__________________________________________________________________________________________________________________________________________________

NAME
clock - Obtain and manipulate time SYNOPSIS
clock option ?arg arg ...? _________________________________________________________________ DESCRIPTION
This command performs one of several operations that may obtain or manipulate strings or values that represent some notion of time. The option argument determines what action is carried out by the command. The legal options (which may be abbreviated) are: clock clicks ?-milliseconds? | Return a high-resolution time value as a system-dependent integer value. The unit of the value is system-dependent but should be | the highest resolution clock available on the system such as a CPU cycle counter. If -milliseconds is specified, then the value is | guaranteed to be of millisecond granularity. This value should only be used for the relative measurement of elapsed time. clock format clockValue ?-format string? ?-gmt boolean? Converts an integer time value, typically returned by clock seconds, clock scan, or the atime, mtime, or ctime options of the file command, to human-readable form. If the -format argument is present the next argument is a string that describes how the date and time are to be formatted. Field descriptors consist of a % followed by a field descriptor character. All other characters are copied into the result. Valid field descriptors are: %% Insert a %. %a Abbreviated weekday name (Mon, Tue, etc.). %A Full weekday name (Monday, Tuesday, etc.). %b Abbreviated month name (Jan, Feb, etc.). %B Full month name. | %c | Locale specific date and time. The format for date and time in the default "C" locale on Unix/Mac is "%a %b %d %H:%M:%S %Y". | On Windows, this value is the locale specific long date and time, as specified in the Regional Options control panel set- | tings. | %C | First two digits of the four-digit year (19 or 20). %d Day of month (01 - 31). | %D | Date as %m/%d/%y. | %e | Day of month (1 - 31), no leading zeros. | %h | Abbreviated month name. %H Hour in 24-hour format (00 - 23). | %I | Hour in 12-hour format (01 - 12). %j Day of year (001 - 366). | %k | Hour in 24-hour format, without leading zeros (0 - 23). | %l | Hour in 12-hour format, without leading zeros (1 - 12). %m Month number (01 - 12). %M Minute (00 - 59). | %n | Insert a newline. %p AM/PM indicator. | %r | Time in a locale-specific "meridian" format. The "meridian" format in the default "C" locale is "%I:%M:%S %p". | %R | Time as %H:%M. | %s | Count of seconds since the epoch, expressed as a decimal integer. %S Seconds (00 - 59). | %t | Insert a tab. | %T | Time as %H:%M:%S. | %u | Weekday number (Monday = 1, Sunday = 7). %U Week of year (00 - 52), Sunday is the first day of the week. | %V | Week of year according to ISO-8601 rules. Week 1 of a given year is the week containing 4 January. | %w | Weekday number (Sunday = 0, Saturday = 6). %W Week of year (00 - 52), Monday is the first day of the week. | %x | Locale specific date format. The format for a date in the default "C" locale for Unix/Mac is "%m/%d/%y". On Windows, this | value is the locale specific short date format, as specified in the Regional Options control panel settings. | %X | Locale specific 24-hour time format. The format for a 24-hour time in the default "C" locale for Unix/Mac is "%H:%M:%S". On | Windows, this value is the locale specific time format, as specified in the Regional Options control panel settings. %y Year without century (00 - 99). %Y Year with century (e.g. 1990) %Z Time zone name. If the -format argument is not specified, the format string "%a %b %d %H:%M:%S %Z %Y" is used. If the -gmt argument is present the | next argument must be a boolean which if true specifies that the time will be formatted as Greenwich Mean Time. If false then the local timezone will be used as defined by the operating environment. clock scan dateString ?-base clockVal? ?-gmt boolean? Convert dateString to an integer clock value (see clock seconds). This command can parse and convert virtually any standard date and/or time string, which can include standard time zone mnemonics. If only a time is specified, the current date is assumed. If the string does not contain a time zone mnemonic, the local time zone is assumed, unless the -gmt argument is true, in which case the clock value is calculated assuming that the specified time is relative to Greenwich Mean Time. -gmt, if specified, affects only the computed time value; it does not impact the interpretation of -base. If the -base flag is specified, the next argument should contain an integer clock value. Only the date in this value is used, not the time. This is useful for determining the time on a specific day or doing other date-relative conversions. The dateString consists of zero or more specifications of the following form: time A time of day, which is of the form: hh?:mm?:ss?? ?meridian? ?zone? or hhmm ?meridian? ?zone?. If no meridian is specified, hh is interpreted on a 24-hour clock. date A specific month and day with optional year. The acceptable formats are mm/dd?/yy?, monthname dd ?, yy?, dd monthname ?yy?, day, dd monthname yy, ?CC?yymmdd, ?CC?yy-mm-dd, dd-monthname-?CC?yy. The default year is the current year. If the year is less than 100, we treat the years 00-68 as 2000-2068 and the years 69-99 as 1969-1999. Not all platforms can represent the | years 38-70, so an error may result if these years are used. ISO 8601 point-in-time An ISO 8601 point-in-time specification, such as CCyymmddThhmmss, where T is the literal T, CCyymmdd hhmmss, or CCyymmd- dThh:mm:ss. relative time A specification relative to the current time. The format is number unit acceptable units are year, fortnight, month, week, day, hour, minute (or min), and second (or sec). The unit can be specified as a singular or plural, as in 3 weeks. These modifiers may also be specified: tomorrow, yesterday, today, now, last, this, next, ago. The actual date is calculated according to the following steps. First, any absolute date and/or time is processed and converted. Using that time as the base, day-of-week specifications are added. Next, relative specifications are used. If a date or day is specified, and no absolute or relative time is given, midnight is used. Finally, a correction is applied so that the correct hour of the day is produced after allowing for daylight savings time differences and the correct date is given when going from the end of a long month to a short month. Daylight savings time correction is applied only when the relative time is specified in units of days or more, ie, days, weeks, fortnights, months or years. This means that when crossing the daylight savings time boundary, different results will be given for clock scan "1 day" and clock scan "24 hours": % clock scan "1 day" -base [clock scan 1999-10-31] 941443200 % clock scan "24 hours" -base [clock scan 1999-10-31] 941439600 clock seconds Return the current date and time as a system-dependent integer value. The unit of the value is seconds, allowing it to be used for relative time calculations. The value is usually defined as total elapsed time from an ``epoch''. You shouldn't assume the value of the epoch. SEE ALSO
date(1), time(n) KEYWORDS
clock, date, time Tcl 8.4 clock(n)
All times are GMT -4. The time now is 11:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy