Sponsored Content
Special Forums UNIX and Linux Applications How to find 'Day of week' in Linux system Post 302331173 by rajinavaneethan on Saturday 4th of July 2009 09:42:07 AM
Old 07-04-2009
How to find 'Day of week' in Linux system

Hi All,

I want to find a day of week for the Linux system.

can some one help me on this..

Thanks in advance,
Raji.
 

10 More Discussions You Might Find Interesting

1. 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

2. UNIX for Dummies Questions & Answers

How to find Day of the Week from the given date (Perl)?

How to find the Day of the Week of the given Date using perl? If I have a date in YYY--MM-DD format, how to find the DOW? Based on that, I need to find the following sunday. Pls help. (5 Replies)
Discussion started by: deepakwins
5 Replies

3. 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

4. UNIX and Linux Applications

Day of week different in windows and Linux

Hi all, My program is getting date from database (oracle) and am getting that date's day of week also. In windows its giving one number and different in linux ;) For Example: 30 - Jun - 2009 Am getting 2 in windows and 3 in Linux. Am not understanding whats going wrong.. Am... (3 Replies)
Discussion started by: rajinavaneethan
3 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. 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

8. 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

9. Shell Programming and Scripting

Reading in MM/DD/YY, find Day of Week

Hi everyone, I have a shell script that merges many files down in to one, then removes unwanted lines, that part is working fine: #!/bin/bash FILES=/home/pi/temp/qbd/* for f in $FILES do echo "Processing $f file..." # take action on each file. $f store current file name echo... (9 Replies)
Discussion started by: gjws
9 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
langinfo.h(3HEAD)						      Headers							 langinfo.h(3HEAD)

NAME
langinfo.h, langinfo - language information constants SYNOPSIS
#include <langinfo.h> DESCRIPTION
The <langinfo.h> header contains the constants used to identify items of langinfo data (see nl_langinfo(3C)). The type of the constant, nl_item, is defined as described in <nl_types.h>. The following constants are defined. The entries under Category indicate in which setlocale(3C) category each item is defined. | | Constant | Category | Meaning ----------------+----------------+---------------------------------------- CODESET |LC_CTYPE |codeset name ----------------+----------------+---------------------------------------- D_T_FMT |LC_TIME |string for formatting date and time ----------------+----------------+---------------------------------------- D_FMT |LC_TIME |date format string ----------------+----------------+---------------------------------------- T_FMT |LC_TIME |time format string ----------------+----------------+---------------------------------------- T_FMT_AMPM |LC_TIME |a.m. or p.m. time format string ----------------+----------------+---------------------------------------- AM_STR |LC_TIME |ante-meridiem affix ----------------+----------------+---------------------------------------- PM_STR |LC_TIME |post-meridiem affix ----------------+----------------+---------------------------------------- DAY_1 |LC_TIME |name of the first day of the week (for | |example, Sunday) ----------------+----------------+---------------------------------------- DAY_2 |LC_TIME |name of the second day of the week (for | |example, Monday) ----------------+----------------+---------------------------------------- DAY_3 |LC_TIME |name of the third day of the week (for | |example, Tuesday) ----------------+----------------+---------------------------------------- DAY_4 |LC_TIME |name of the fourth day of the week (for | |example, Wednesday) ----------------+----------------+---------------------------------------- DAY_5 |LC_TIME |name of the fifth day of the week (for | |example, Thursday) ----------------+----------------+---------------------------------------- DAY_6 |LC_TIME |name of the sixth day of the week (for | |example, Friday) ----------------+----------------+---------------------------------------- DAY_7 |LC_TIME |name of the seventh day of the week | |(for example, Saturday) ----------------+----------------+---------------------------------------- ABDAY_1 |LC_TIME |abbreviated name of the first day of | |the week ----------------+----------------+---------------------------------------- ABDAY_2 |LC_TIME |abbreviated name of the second day of | |the week ----------------+----------------+---------------------------------------- ABDAY_3 |LC_TIME |abbreviated name of the third day of | |the week ----------------+----------------+---------------------------------------- ABDAY_4 |LC_TIME |abbreviated name of the fourth day of | |the week ----------------+----------------+---------------------------------------- ABDAY_5 |LC_TIME |abbreviated name of the fifth day of | |the week ----------------+----------------+---------------------------------------- ABDAY_6 |LC_TIME |abbreviated name of the seventh day of | |the week ----------------+----------------+---------------------------------------- ABDAY_7 |LC_TIME |abbreviated name of the seventh day of | |the week ----------------+----------------+---------------------------------------- MON_1 |LC_TIME |name of the first month of the year ----------------+----------------+---------------------------------------- MON_2 |LC_TIME |name of the second month ----------------+----------------+---------------------------------------- MON_3 |LC_TIME |name of the third month ----------------+----------------+---------------------------------------- MON_4 |LC_TIME |name of the fourth month ----------------+----------------+---------------------------------------- MON_5 |LC_TIME |name of the fifth month ----------------+----------------+---------------------------------------- MON_6 |LC_TIME |name of the sixth month ----------------+----------------+---------------------------------------- MON_7 |LC_TIME |name of the seventh month ----------------+----------------+---------------------------------------- MON_8 |LC_TIME |name of the eighth month ----------------+----------------+---------------------------------------- MON_9 |LC_TIME |name of the ninth month ----------------+----------------+---------------------------------------- MON_10 |LC_TIME |name of the tenth month ----------------+----------------+---------------------------------------- MON_11 |LC_TIME |name of the eleventh month ----------------+----------------+---------------------------------------- MON_12 |LC_TIME |name of the twelfth month ----------------+----------------+---------------------------------------- ABMON_1 |LC_TIME |abbreviated name of the first month ----------------+----------------+---------------------------------------- ABMON_2 |LC_TIME |abbreviated name of the second month ----------------+----------------+---------------------------------------- ABMON_3 |LC_TIME |abbreviated name of the third month ----------------+----------------+---------------------------------------- ABMON_4 |LC_TIME |abbreviated name of the fourth month ----------------+----------------+---------------------------------------- ABMON_5 |LC_TIME |abbreviated name of the fifth month ----------------+----------------+---------------------------------------- ABMON_6 |LC_TIME |abbreviated name of the sixth month ----------------+----------------+---------------------------------------- ABMON_7 |LC_TIME |abbreviated name of the seventh month ----------------+----------------+---------------------------------------- ABMON_8 |LC_TIME |abbreviated name of the eighth month ----------------+----------------+---------------------------------------- ABMON_9 |LC_TIME |abbreviated name of the ninth month ----------------+----------------+---------------------------------------- ABMON_10 |LC_TIME |abbreviated name of the tenth month ----------------+----------------+---------------------------------------- ABMON_11 |LC_TIME |abbreviated name of the eleventh month ----------------+----------------+---------------------------------------- ABMON_12 | LC_TIME |abbreviated name of the twelfth month ----------------+----------------+---------------------------------------- ERA |LC_TIME |era description segments ----------------+----------------+---------------------------------------- ERA_D_FMT |LC_TIME |era date format string ----------------+----------------+---------------------------------------- ERA_D_T_FMT |LC_TIME |era date and time format string ----------------+----------------+---------------------------------------- ERA_T_FMT |LC_TIME |era time format string ----------------+----------------+---------------------------------------- ALT_DIGITS |LC_TIME |alternative symbols for digits ----------------+----------------+---------------------------------------- RADIXCHAR |LC_NUMERIC |radix character ----------------+----------------+---------------------------------------- THOUSEP |LC_NUMERIC |separator for thousands ----------------+----------------+---------------------------------------- YESEXPR |LC_MESSAGES |affirmative response expression ----------------+----------------+---------------------------------------- NOEXPR |LC_MESSAGES |negative response expression ----------------+----------------+---------------------------------------- YESSTR |LC_MESSAGES |affirmative response for yes/no queries ----------------+----------------+---------------------------------------- NOSTR |LC_MESSAGES |negative response ro yes/no queries ----------------+----------------+---------------------------------------- CRNCYSTR |LC_MONETARY |local currency symbol, preceded by '-' | |if the symbol sould appear before the | |value, '+' if the symbol should appear | |after the value, or '.' if the symbol | |should replace the radix character If the locale's values for p_cs_precedes and n_cs_precedes do not match, the value of nl_langinfo(CRNCYSTR) is unspecified. The <langinfo.h> header declares the following as a function: char *nl_langinfo(nl_item); Inclusion of <langinfo.h> header may also make visible all symbols from <nl_types.h>. USAGE
Wherever possible, users are advised to use functions compatible with those in the ISO C standard to access items of langinfo data. In par- ticular, the strftime(3C) function should be used to access date and time information defined in category LC_TIME. The localeconv(3C) func- tion should be used to access information corresponding to RADIXCHAR, THOUSEP, and CRNCYSTR. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
mkmsgs(1), localeconv(3C), nl_langinfo(3C), nl_types.h(3HEAD), setlocale(3C), strftime(3C), attributes(5), standards(5) SunOS 5.11 30 Aug 2002 langinfo.h(3HEAD)
All times are GMT -4. The time now is 06:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy