03-04-2020
Thanks RudiC,
It works & gives correct value as well.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi
Can any buddy give mi a simple program or logic or command which will get
difference between two dates
ex:diff between 20051008 2005908 is 24hours 12 min 2 sec
regards (1 Reply)
Discussion started by: rajuMBT
1 Replies
2. Shell Programming and Scripting
if there are two date one is entered by user
and another is system date than how can we finds day difference
between these two date
try to make it within 4 lines (2 Replies)
Discussion started by: piyush_movadiya
2 Replies
3. Linux
hi,
i have 2 dates in the form: '20080315120030' and '20080310140030'. i.e. YYYYMMDDHHMMSS.
i need a way of getting the difference between them using shell script.
any thoughts? (14 Replies)
Discussion started by: muay_tb
14 Replies
4. Shell Programming and Scripting
Hi All!
I would like to know the time difference between two dates which are in same format...
$ date -r abc
Thu Oct 29 09:40:37 EDT 2009
$ date
Fri Oct 30 02:07:03 EDT 2009
i would like to find the diff between these two dates in hours..please help..:)
Regards,
Kiran (3 Replies)
Discussion started by: dddkiran
3 Replies
5. Shell Programming and Scripting
Dear all,
I fancy that I'm pretty competent in ksh, but I have someone on HP-UX wanting me to script up a simple interface to handle user alterations rather than giving them high privileges to run up SAM. This is all fairly straightforward, but I'm stuck on an epoch date issue.
When we have... (6 Replies)
Discussion started by: rbatte1
6 Replies
6. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
The problem i have is that i probably make a few mistake here in the code but don't know what it is and i try to get the date difference but don't know where to add the days_in_month function
2. Relevant commands, code,... (1 Reply)
Discussion started by: mgyeah
1 Replies
7. Programming
I tried the below code to find difference between two dates. It works fine if the day of the month is 2-digit number. But it fails when we have a single-digit day of month(ex:1-9). my code is as below. please help me soon.
#!/usr/bin/perl -w
use strict;
use Time::Local;
... (2 Replies)
Discussion started by: anandrec
2 Replies
8. Shell Programming and Scripting
HI All ,
i need a bash script to find the number of days between two dates .
Format YYYY-MM-DD
THanks,
Neil (1 Reply)
Discussion started by: nevil
1 Replies
9. AIX
Hi Everyone,
We are having an issue with date and date -u in our AIX Systems.
We have checked environment variable TZ and /etc/environment and however, we could not rectify the difference.
>date
Thu Mar 19 22:31:40 IST 2015
>date -u
Thu Mar 19 17:01:44 GMT 2015
Any clue... (5 Replies)
Discussion started by: madhav.kunapa
5 Replies
10. Shell Programming and Scripting
Hi,
I created a script for finding the duration of a job using the start and end time of the job. But the command doesnt calculate correct value if the duration is more than 24 hours. Any help would be really good
.
cat test1 --- start time
03/27/15 17:41:00
03/24/15 11:58:04
03/23/15... (3 Replies)
Discussion started by: rogerben
3 Replies
ex12bit(3alleg4) Allegro manual ex12bit(3alleg4)
NAME
ex12bit - How to fake a 12-bit truecolor mode on an 8-bit card. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
Example ex12bit
DESCRIPTION
This program sets up a 12-bit mode on any 8-bit card, by setting up a 256-colour palette that will fool the eye into grouping two 8-bit
pixels into one 12-bit pixel. In order to do this, you make your 256-colour palette with all the combinations of blue and green, assuming
green ranges from 0-15 and blue from 0-14. This takes up 16x15=240 colours. This leaves 16 colours to use as red (red ranges from 0-15).
Then you put your green/blue in one pixel, and your red in the pixel next to it. The eye gets fooled into thinking it's all one pixel.
The example starts setting a normal 256 color mode, and construct a special palette for it. But then comes the trick: you need to write to
a set of two adjacent pixels to form a single 12 bit dot. Two eight bit pixels is the same as one 16 bit pixel, so after setting the video
mode you need to hack the screen bitmap about, halving the width and changing it to use the 16 bit drawing code. Then, once you have packed
a color into the correct format (using the makecol12() function below), any of the normal Allegro drawing functions can be used with this
12 bit display!
Things to note:
The horizontal width is halved, so you get resolutions like 320x480, 400x600, and 512x768.
Because each dot is spread over two actual pixels, the display will be darker than in a normal video mode.
Any bitmap data will obviously need converting to the correct 12 bit format: regular 15 or 16 bit images won't display correctly...
Although this works like a truecolor mode, it is actually using a 256 color palette, so palette fades are still possible!
This code only works in linear screen modes (don't try Mode-X).
SEE ALSO
BITMAP(3alleg4), END_OF_MAIN(3alleg4), MATRIX(3alleg4), PALETTE(3alleg4), RGB(3alleg4), allegro_error(3alleg4), allegro_init(3alleg4),
allegro_message(3alleg4), apply_matrix(3alleg4), blit(3alleg4), circle(3alleg4), clear_bitmap(3alleg4), clear_keybuf(3alleg4),
clear_to_color(3alleg4), create_bitmap(3alleg4), create_bitmap_ex(3alleg4), destroy_bitmap(3alleg4), ellipsefill(3alleg4),
fade_out(3alleg4), fixcos(3alleg4), fixed(3alleg4), fixsin(3alleg4), fixtoi(3alleg4), font(3alleg4), get_rotation_matrix(3alleg4), get-
pixel(3alleg4), install_keyboard(3alleg4), itofix(3alleg4), keypressed(3alleg4), line(3alleg4), makecol(3alleg4), masked_blit(3alleg4),
putpixel(3alleg4), screen(3alleg4), set_clip_rect(3alleg4), set_color(3alleg4), set_gfx_mode(3alleg4), set_palette(3alleg4),
text_height(3alleg4), text_length(3alleg4), textout_ex(3alleg4), textprintf_ex(3alleg4)
Allegro version 4.4.2 ex12bit(3alleg4)