Sponsored Content
Top Forums Shell Programming and Scripting How to calculate the total number of weeks from a specify year? Post 302764137 by rayray2013 on Thursday 31st of January 2013 03:27:31 AM
Old 01-31-2013
calculate the total number of week from 01 Jan 2012 to current date.
Thx!
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How many weeks in a year

Hi, I search how i could do to find if a year (for example 2004, 1989, 2058) has 52 or 53 weeks... Have you a idea for me please??? (1 Reply)
Discussion started by: Castelior
1 Replies

2. UNIX for Dummies Questions & Answers

calculate directory size by year of file

I need to calcualte the size of a directory by the year the files in that directory were created . For example the script will sum up, by year, the number of blocks for that directory and its' subdirectories for files created / accessed in that year. I need a report that would look like... (11 Replies)
Discussion started by: igidttam
11 Replies

3. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies

4. Shell Programming and Scripting

Help with sum total number of record and total number of record problem asking

Input file SFSQW 5192.56 HNRNPK 611.486 QEQW 1202.15 ASDR 568.627 QWET 6382.11 SFSQW 4386.3 HNRNPK 100 SFSQW 500 Desired output file SFSQW 10078.86 3 QWET 6382.11 1 QEQW 1202.15 1 HNRNPK 711.49 2 ASDR 568.63 1 The way I tried: (2 Replies)
Discussion started by: patrick87
2 Replies

5. Shell Programming and Scripting

How do I calculate total number of active and non active hosts?

#!/bin/bash for digit in $(seq 1 10) do if ping -c1 -w2 192.168.1.$digit &> /dev/null then echo "192.168.1.$digit is UP" else echo "192.168.1.$digit is DOWN" fi done (3 Replies)
Discussion started by: fusetrips
3 Replies

6. AIX

How to calcuate total number of weeks?

Hi anyone can help? How to calculate total number of weeks from a specify date, for example, 01 Jan 2012. Thx! https://www.unix.com/images/misc/progress.gif (1 Reply)
Discussion started by: rayray2013
1 Replies

7. Shell Programming and Scripting

Calculate the total

Hi All , I have the following script as below , I tried to modify to meet the requirement , could someone help ? very thanks ================================================================================================ while read STR NAME; do Total=0 MyString="$STR" GetData () {... (18 Replies)
Discussion started by: ust3
18 Replies

8. UNIX for Beginners Questions & Answers

Best way to increment weeks based on fiscal start year

Hi Folks - I'm looking for the best way to to increment fiscal weeks - allow me to explain. At my one client, 10/01/17 was the beginning if year fiscal year 2018. Each week, I need to manage a unique set of variable that are updated in my application - they are called substitution variables.... (31 Replies)
Discussion started by: SIMMS7400
31 Replies

9. Solaris

How to calculate total number of cores on my servers ?

Hi, I want to get total number of cores on my all non-global zones on Solaris 10. I got two methods and both are giving different results. Below link is a script, which tells me that total cores are 8 Mandalika's scratchpad: Oracle Solaris: Show Me the CPU, vCPU, Core Counts and the... (4 Replies)
Discussion started by: ron323232
4 Replies
GETDATE(3)						     Library Functions Manual							GETDATE(3)

NAME
getdate - convert time and date from ASCII SYNOPSIS
#include <sys/types.h> #include <sys/timeb.h> time_t getdate(buf, now) char *buf; struct timeb *now; DESCRIPTION
Getdate is a routine that converts most common time specifications to standard UNIX format. The first argument is the character string containing the time and date; the second is the assumed current time (used for relative specifications); if NULL is passed, ftime(2) is used to obtain the current time and timezone. The character string consists of 0 or more specifications of the following form: tod A tod is a time of day, which is of the form hh:mm[:ss] (or hhmm) [meridian] [zone]. If no meridian - am or pm - is specified, a 24-hour clock is used. A tod may be specified as just hh followed by a meridian. date A date is a specific month and day, and possibly a year. Acceptable formats are mm/dd[/yy] and monthname dd[, yy] If omitted, the year defaults to the current year; if a year is specified as a number less than 100, 1900 is added. If a number not followed by a day or relative time unit occurs, it will be interpreted as a year if a tod, monthname, and dd have already been specified; other- wise, it will be treated as a tod. This rule allows the output from date(1) or ctime(3) to be passed as input to getdate. day A day of the week may be specified; the current day will be used if appropriate. A day may be preceeded by a number, indicating which instance of that day is desired; the default is 1. Negative numbers indicate times past. Some symbolic numbers are accepted: last, next, and the ordinals first through twelfth (second is ambiguous, and is not accepted as an ordinal number). The symbolic number next is equivalent to 2; thus, next monday refers not to the immediately coming Monday, but to the one a week later. relative time Specifications relative to the current time are also accepted. The format is [number] unit; acceptable units are year, month, fort- night, week, day, hour, minute, and second. The actual date is formed as follows: first, any absolute date and/or time is processed and converted. Using that time as the base, day- of-week specifications are added; last, 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. Getdate accepts most common abbreviations for days, months, etc.; in particular, it will recognize them with upper or lower case first let- ter, and will recognize three-letter abbreviations for any of them, with or without a trailing period. Units, such as weeks, may be speci- fied in the singular or plural. Timezone and meridian values may be in upper or lower case, and with or without periods. FILES
/usr/lib/libu.a SEE ALSO
ctime(3), time(2) AUTHOR
Steven M. Bellovin (unc!smb) Dept. of Computer Science University of North Carolina at Chapel Hill BUGS
Because yacc(1) is used to parse the date, getdate cannot be used a subroutine to any program that also needs yacc. The grammar and scanner are rather primitive; certain desirable and unambiguous constructions are not accepted. Worse yet, the meaning of some legal phrases is not what is expected; next week is identical to 2 weeks. The daylight savings time correction is not perfect, and can get confused if handed times between midnight and 2:00 am on the days that the reckoning changes. Because localtime(2) accepts an old-style time format without zone information, attempting to pass getdate a current time containing a dif- ferent zone will probably fail. unc GETDATE(3)
All times are GMT -4. The time now is 04:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy