General :: Calculate Local Time In Seconds?
Sep 3, 2010I`m looking to calculate my Local Time in seconds from APOC - 1970.I found only - date +%s -> that display the UTC and not my Local Time.
View 3 RepliesI`m looking to calculate my Local Time in seconds from APOC - 1970.I found only - date +%s -> that display the UTC and not my Local Time.
View 3 RepliesI would like to subtract the end time with a start time in bash. How can I do it?
Here's a script of example of what I want:
Now i am writting one bash script. in that my requirement is i need to create one directory and that the directory details to be stored in one file Ex. date/time and all in one file. after that i need to delete the folder automatically exactly after 3months. between these time period in 2month itself i need to send one mail to admin "regarding this still one month only more to delete the folder" . is it possible to do like that date calculation in script.
View 10 Replies View RelatedI have log file in formatJun/26/2011 01:17:50 wireless ....Jun/26/2011 18:25:15 wireless ....Jun/26/2011 22:34:43 wireless ....I need to put this in format ( only seconds insted hours:minutes:secondes)Jun/26/2011 4670s wireless ....Jun/26/2011 66315s wireless ....Jun/26/2011 81283s wireless ....If i useawk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }' output iz only 4670,66315,81283....I try to use something likesed "s/ ([0-9][0-9]):([0-9][0-9]):([0-9][0-9] )/`awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }'` /g"but doesn't work
View 2 Replies View Relatedtime() API gives the number of seconds since 1970 Jan 1st 00:00:00 without considering leap seconds. How to get the number of leap seconds which needs to be considered in the value returned by time()..(gmtime will convert time_t to struct tm* and considers leap seconds. I am trying to write an API which will do the same function as gmtime)
View 5 Replies View RelatedLinux bash inline command to execute a program and limit the resource.As I know, to limit the resource I can use ulimit command.But, the problem is when I set the CPU time limit 1 second, and then I want to execute another program with CPU limit 2s, the ulimit command return an error like this: bash: ulimit: CPU time: cannot modify limit: Operation not permitted and absolutely my program killed in 1 second.So, How can I make the second program running with the CPU time limit 2 seconds?
View 3 Replies View Relatedim trying to calculate how much time does my program run, use very simple script
clock_t end, start;
start= clock();
int i;
printf("initial %d
",(int)start);
[Code]....
but it outputs 0 all the time. cant figure out where could be the problem.
i have the example code below, i want to calculate the time taken for a sample program to run. but i keep getting undefined reference error.
#include <sys/time.h>
#include <iostream>
int main(int argc, char **argv) {
struct timeval startTime;
struct timeval endTime;
[Code]...
I am trying to set time using settimeofday in linux. But it sets local time. i.e works like SetLocalTime in windows. But I want to set system time(like SetSystemTime in windows). I could'nt find no other api in linux. What should i do? I had tried with mktime/gmtime apis
View 3 Replies View RelatedI'd like to have a copy of a web site on my local drive. Then when I make changes to that copy, have those changes automatically updated on the site's server. Ideally I'd like to tell it to only do this for certain file types. Does anybody know of a way to do this with Linux?
View 2 Replies View RelatedI use Debian Lenny .I installed NTP server on my debian and take following changes to /etc/ntp.confserver 127.127.1.0fudge 127.127.1.0 stratum 10but when I try to sync time from clients I cant and I see following error message :no suitable server found for synchronization
View 1 Replies View RelatedI need to know how to get the current time with nano seconds on a linux box using c++?
View 3 Replies View RelatedIs there a way for the time at the top of the screen to display seconds as well as the date ?
My clock seems to be about :40 seconds off... before i upgraded from f-13 i had my time controlled by ntp(how to verify ntp is enabled) ? even with network time = yes, it seems to lag a little.
I figured out the network time. it is under a whole separate menu for some reason.
Is there a way to get weather/ temperature like in classic gnome ?
Rite now my clock reads: tue 3:50 pm...Is there a way i can make it read: tue, aug 20, 2011 3:50:45 pm
I know this isnt normal for everyone but im getting a 29 to 30 second bootup on 10.04 from grub to login screen.. i installed boot up manager and disabled some of the things listed on a few recommendation pages on google where would i begin to figure this out? before i upgraded i was booting up at like 10 seconds tops..
View 1 Replies View RelatedMy ubuntu(10.10) installation takes a relatively longer time (90 seconds) to boot. I think part of the problem might be related to an error message during boot related to usb drivers.
Code:
[2.717076] usb 4-1: new low speed USB device using ohci_hcd and address 2
[3.244051] usb 4-2: new full speed USB device using ohci_hcd and address 3
[12.029046] /build/buildd/linux-2.6.35/drivers/hid/usbhid/hid-core.c: usb_submit_urb(ctrl) failed
I have attached the relevant part of dmesg output also.
i use Totem movie player every time i play any video it's forwarding a few seconds it self.
View 3 Replies View RelatedI've been using Thunderbird 3.0.x for some time and found in it a good replacement of TheBat. However, few days ago, ubuntu being ubuntu crashed and since then, Thunderbird freezes after 10 seconds every time I try to start it, sending CPU usage through the roof. I have 8 imap accounts in it and my profile folder is ~2.8gb I tried purging the installation. I tried fsck on all partitions. Windows Thunderbird using the same profile folder works just fine.
View 6 Replies View RelatedI upgraded a HP Proliant server to openSUSE 11.4 (X86-64) with KDE, and I'm encountering various graphical problems. This machine's been running SUSE versions since 11.0 on similar hardware with few major issues, and I did the 'upgrade' by a new install keeping only /home partition intact. This Server has 10GB memory. It has a PCI ATI ES1000 with 64MB and uses the radeon driver. It boots up fine under the monitor's correct resolution of 1600*1000, but
1) It flickers one time each 4 of 5 seconds
2) during works more and more memory is used : starting at 9% and going up to 51% after 20 minutes and I receive then allocation error in /var/log/messages
[Code]...
ive searched the forums and web for info on this but i am stumped.not unusual since i started to use linux.gparted crashes after about 3 seconds of grayed out screentime.here is my terminal readout after entering sudo gparted command.tenza@tenza-desktop:~$ sudo gparted
[Code]....
Before my windows clock was at local time + 2h. Now my Win clock is ok but my F11 clock is at local time +2h. What happened?!
View 9 Replies View RelatedTry as I might I cannot seem to get the system clock to display local time. It looks like it's stuck on GMT. In the System>Administration>Time and Date I have my local time zone set correctly and also set to update automatically with an appropriate time server selected. It still displays my local time +5 hours (I'm central time, USA).
View 6 Replies View RelatedNTPD on Fedora 14.
View 2 Replies View RelatedI am familiar with common video resolutions like 320x240, 640x480 and 720x480. Sometimes I want to use other video resolutions when encoding videos. Is there a formula to calculate the unknown value for the heightxwidth if one value is supplied? For example, if I want my video to be 480xWidth, what value should Width be to get proper aspect.
View 2 Replies View RelatedI have a csv file (id, loc, timestamp, impressions) that I need to derive some low-level calculations from. Im ok with basic sort and grep operations, but this one is challenging my feeble scripting skills (normally I�d throw it into a spreadsheet, but in this case Id like to ultimately create a script that I could automate). Ive already used cat/sort to order the csv file first on location and then timestamp so it looks like this:
Abt001, AA, 2009-01-01 10:51:00, 231
Cup002, AA, 2009-01-01 10:54:00, 3
Saf001, AB, 2009-01-01 10:51:00, 25
[code]....
What Id like to do is output to file a record of the total, min, and max number of impressions for each location. , e.g.
AA6504 3231
AB252525
AC37925109
ZZ35512341
how to do this and Im kind of stuck on how to approach it I think the combined steps of looping through the locations along with the min/max/sum calculations are throwing me. Eventually Id also like to do additional calculations like average, ect. but I think I can figure that out on my own if I can just get this part down.
Between the dates 21-June-2007 to 12-December-2010 there are 1270 days. If the total cumulative time a hard drive has been active is 344 days (found this via Disk Utility in Ubuntu 10.10) since it was bought 1270 days ago. What is the average usage hours per day?
View 2 Replies View Relatedi have a debian 5 vps system.. it reports the time as beeing one hour behind, i have tried to change this by setting the time to GMT+1 and setting the time to my local region (Europe-Brittian) using the tzselect command but none get the time to the correct time, one hour ahead of the current time.
View 3 Replies View RelatedWhen I travel, I would like to tell my laptop that I, as a user, am in a different time zone that what the OS may think is local. And I would like the clock on my desktop (default Gnome bar date/time display) to show the local time.
Instead, I currently have to use sudo and change the system time... (click on the clock, choose time settings, set system time -- there are no other choices given). The applet thing allows me to add other locations, but they only show up if I click on the icon, as extra times below the main one.
Am I missing something? Using the wrong app?
is there a way to calculate the total memory consumed by user ?
View 12 Replies View RelatedHow do you calculate the number of usable bytes on a disk partition? When I do an fdisk -l I get this:
Disk /dev/md0: 192.0 GB, 192069500928 bytes
2 heads, 4 sectors/track, 46891968 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
[code]...
My shell script is calculating the count of each shortcode series wise whose sample output is as follows:
Code:
56882
9124 1
9172 1
9173 4
[code]....