Sponsored Content
Full Discussion: Date conversion
Top Forums UNIX for Beginners Questions & Answers Date conversion Post 302980758 by Don Cragun on Friday 2nd of September 2016 02:37:54 AM
Old 09-02-2016
Quote:
Originally Posted by srinadhreddy27
Hi,

Code:
bash-3.2$  gdate +%A -d 20150616
bash: gdate: command not found
bash-3.2$ which gdate
no gdate in /usr/bin /bin
bash-3.2$ uname -a
SunOS pfdbfd01 5.10 Generic_150400-34 sun4v sparc sun4v
bash-3.2$ date -d "20150616" +"%Y%m%d"
date: illegal option -- d
usage:  date [-u] mmddHHMM[[cc]yy][.SS]
        date [-u] [+format]
        date -a [-]sss[.fff]


I am getting above error ...

Thanks,
Srinadh

Moderator's Comments:
Mod Comment Use code tags, thanks.
Hi Srinadh,
Try:
Code:
/usr/[gG][nN][uU]/bin/date -d 20150616 "+%A"

If that doesn't work either, I still think the code I suggested in post #9 in this thread should work for you. Have you tried the code I suggested there?

Last edited by Don Cragun; 09-02-2016 at 03:40 AM.. Reason: Fix typo: s/"+%B"/"+%A"/
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Date Conversion

Hello, I want to convert MM DD YYYY date format to MM-DD-YYYY format. For exemple: I have to convert Nov 28 2005 to 28-11-2005. Thenks for youf help. DAFI (2 Replies)
Discussion started by: dafidak
2 Replies

2. Shell Programming and Scripting

date conversion

Hi everybody: Could anybody tell me how I convert from a julian date, with shell comands, to gregorian. Thanks in advance. (2 Replies)
Discussion started by: tonet
2 Replies

3. Shell Programming and Scripting

date conversion

file1 E106,0,1/9/1993,0,E001,E003,A,45200,3766.667,21.730769 E108,0,2/3/1995,0,E001,E003,A,15000,1250,7.211538 E109,0,06-mar-07,0,E001,E001,A,78000,6500,37.5 E110,0,09-dec-2008,0,E001,E001,A,56000,4666.667,26.923077 E104,0,06/04/1994,0,E001,E003,A,95000,7916.667,45.673077... (14 Replies)
Discussion started by: charandevu
14 Replies

4. Shell Programming and Scripting

Date Conversion

Hi, Does anyone know (in KSH, CSH, SED or AWK), how to convert date text in a file from: EX: May232008 to: 05232008 Thanks, (3 Replies)
Discussion started by: jgrant746
3 Replies

5. Shell Programming and Scripting

Date conversion

Hi I want to convert MAY 05 2005 01:15:00PM date format to 2005/05/05 01:15:00PM . CAn somebody suggest me a code ,I am new to unix shell programming. Thanks Arif (21 Replies)
Discussion started by: mab_arif16
21 Replies

6. Shell Programming and Scripting

Date conversion

Hi, I have the string YYYYMMDDHHMMSS like 20090801204150 and I need to convert it using the unix command date in the format: date "Saturday, 1 August 2009 20:40:59" All in one single Unix line if this is possible. What's the correct syntax? Steve Hagi (6 Replies)
Discussion started by: hagimeno
6 Replies

7. Shell Programming and Scripting

Conversion of date to Julian date

Hi Gurus, Need help in Conversion of date(2007-11-30) to Julian date(YYDDD)... '+%J' 2007-11-30 to 'YYDDD' Thanks (4 Replies)
Discussion started by: SeenuGuddu
4 Replies

8. UNIX for Dummies Questions & Answers

Date conversion in ab i

(string(8)) ((date("YYYYMMDD")) ((date("YYYY/MM/DD")) in.date_field_name)) (1 Reply)
Discussion started by: dr46014
1 Replies

9. Shell Programming and Scripting

Julian date to Calendar date conversion

Hi all, I require to convert julian date to normal calander date in unix for eg julian date=122 now i want corresponding calander date ---------------------------------------- gr8 if give very small command/script and please explain the steps as well(imp) Thanks ... (3 Replies)
Discussion started by: RahulJoshi
3 Replies

10. Shell Programming and Scripting

Date conversion

Trying to convert dates using a Perl Script but it has to accept formats like 3 letter month, day and year like Nov 02 2010 or 1/4/11 or 21 Feb 2011 and have it convert to something like October 20, 2011. Any ideas? (2 Replies)
Discussion started by: reduxeffect81
2 Replies
ddi_removing_power(9F)					   Kernel Functions for Drivers 				    ddi_removing_power(9F)

NAME
ddi_removing_power - check whether DDI_SUSPEND might result in power being removed from a device SYNOPSIS
#include <sys/ddi.h> #include <sys/sunddi.h> int ddi_removing_power(dev_info_t *dip); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI) DESCRIPTION
The ddi_removing_power() function indicates whether a currently pending call into a driver's detach(9E) entry point with a command of DDI_SUSPEND is likely to result in power being removed from the device. ddi_removing_power() can return true and power still not be removed from the device due to a failure to suspend and power off the system. PARAMETERS
The ddi_removing_power() function supports the following parameter: dip pointer to the device's dev_info structure RETURN VALUES
The ddi_removing_power() function returns: 1 Power might be removed by the framework as a result of the pending DDI_SUSPEND call. 0 Power will not be removed by the framework as a result of the pending DDI_SUSPEND call. EXAMPLES
Example 1 Protecting a Tape from Abrupt Power Removal A tape driver that has hardware that would damage the tape if power is removed might include this code in its detach(9E) code: int xxdetach(dev_info_t *dip, ddi_detach_cmd_t cmd) { ... case DDI_SUSPEND: /* * We do not allow DDI_SUSPEND if power will be removed and * we have a device that damages tape when power is removed * We do support DDI_SUSPEND for Device Reconfiguration, * however. */ if (ddi_removing_power(dip) && xxdamages_tape(dip)) return (DDI_FAILURE); ... ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), cpr(7), attach(9E), detach(9E) Writing Device Drivers SunOS 5.11 14 March 2001 ddi_removing_power(9F)
All times are GMT -4. The time now is 07:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy