How to convert GMT to PST and PDT time in oracle - oracle

GMT to PST conversion and GMT to DST conversion

Did you make up your own time zone region? There is no place in the world where daylight saving is from the first Friday in March till the first Monday in November.
Other than that the question is trivial - use the at time zone operator, like below. Note that I use a timestamp literal for the input, but you could use any expression that evaluates to a timestamp in the 'GMT' time zone (or in any time zone for that matter). Note that 'America/Los_Angeles' follows the PST/PDT model, but not with the dates you indicated in your question.
select timestamp '2020-10-29 01:30:00.000 GMT'
at time zone 'America/Los_Angeles' as pst_pdt_time
from dual;
PST_PDT_TIME
-----------------------------------------------
2020-10-28 18:30:00.000 America/Los_Angeles PDT

Time zone PST and/or PDT are ambiguous, see
SELECT tzname, tzabbrev, TZ_OFFSET(tzname)
FROM V$TIMEZONE_NAMES
WHERE tzabbrev IN ('PST','PDT')
OR tzname IN ('PST','PDT');
TZNAME
TZABBREV
TZ_OFFSET(TZNAME)
America/Bahia_Banderas
PST
-06:00
America/Boise
PST
-07:00
America/Boise
PDT
-07:00
America/Creston
PST
-07:00
America/Dawson
PST
-08:00
America/Dawson
PDT
-08:00
America/Dawson_Creek
PST
-07:00
America/Dawson_Creek
PDT
-07:00
America/Ensenada
PST
-08:00
America/Ensenada
PDT
-08:00
America/Hermosillo
PST
-07:00
America/Inuvik
PST
-07:00
America/Juneau
PST
-09:00
America/Juneau
PDT
-09:00
America/Los_Angeles
PST
-08:00
America/Los_Angeles
PDT
-08:00
America/Mazatlan
PST
-07:00
America/Metlakatla
PST
-08:00
America/Metlakatla
PDT
-08:00
America/Santa_Isabel
PST
-08:00
America/Santa_Isabel
PDT
-08:00
America/Sitka
PST
-09:00
America/Sitka
PDT
-09:00
America/Tijuana
PST
-08:00
America/Tijuana
PDT
-08:00
America/Vancouver
PST
-08:00
America/Vancouver
PDT
-08:00
America/Whitehorse
PST
-08:00
America/Whitehorse
PDT
-08:00
Canada/Pacific
PST
-08:00
Canada/Pacific
PDT
-08:00
Canada/Yukon
PST
-08:00
Canada/Yukon
PDT
-08:00
Mexico/BajaNorte
PST
-08:00
Mexico/BajaNorte
PDT
-08:00
Mexico/BajaSur
PST
-07:00
Pacific/Pitcairn
PST
-08:00
PST
LMT
-08:00
PST
PST
-08:00
PST
PDT
-08:00
PST
PWT
-08:00
PST
PPT
-08:00
PST8PDT
PDT
-08:00
PST8PDT
PST
-08:00
US/Pacific
PST
-08:00
US/Pacific
PDT
-08:00
US/Pacific-New
PST
-08:00
US/Pacific-New
PDT
-08:00
Use timezone region name as shown by #mathguy. These region names also apply correct rule for DST changes.

Related

Elasticdump and Elasticsearch

I'm using elasticdump and got weird error
Mon, 14 Nov 2022 14:42:21 GMT | starting dump
Mon, 14 Nov 2022 14:42:22 GMT | got 10 objects from source elasticsearch (offset: 0)
Mon, 14 Nov 2022 14:42:22 GMT | sent 10 objects to destination file, wrote 10
Mon, 14 Nov 2022 14:42:22 GMT | Error Emitted => This and all future requests should be directed to the given URI.
Mon, 14 Nov 2022 14:42:22 GMT | Error Emitted => This and all future requests should be directed to the given URI.
Mon, 14 Nov 2022 14:42:22 GMT | Total Writes: 0
Mon, 14 Nov 2022 14:42:22 GMT | dump ended with error (get phase) => MOVED_PERMANENTLY: This and all future requests should be directed to the given URI.
It successfully moved 10 objects and stopped
--input-index is for a different use case.
Try with just --input like this
elasticdump --input=http://localhost/dev_index --output=test2.json

Filter Git Tags based on date

I'm currently building a versioning pipeline that would automatically promote tags based on date. I am able to return all my tags with this command: git for-each-ref --format="%(refname:short) | %(creatordate)" "refs/tags/*"
Which outputs something like this:
v1.0.0 | Mon Jan 24 14:36:19 2022 -0600
v1.1.0 | Mon Jan 24 14:37:06 2022 -0600
v1.1.1 | Mon Jan 24 14:40:39 2022 -0600
v1.1.2 | Tue Jan 25 17:47:32 2022 +0000
v1.1.3 | Tue Jan 25 21:20:03 2022 +0000
v1.1.4 | Tue Jan 25 21:22:40 2022 +0000
v1.2.0 | Tue Jan 25 21:24:08 2022 +0000
v1.3.0 | Tue Jan 25 21:52:28 2022 +0000
I'm looking to take this output and filter it based on current date. So for example if I want all tags created after Jan 24, I'd need to filter this output to only return the tags created from the 25th and beyond.
I'm thinking awk could help with this but I'm uncertain.. Any tips would be great!

Unexplained deletion of PNG files from OSX Desktop 10 seconds after creation

This bizarre thing has just started happening on my Mac which I don't understand. New .png files copied into ~/Desktop are being deleted within 10 seconds of being placed there.
It doesn't have happen with .txt files. It doesn't happen with .png files that are actually text files. It does happen with .txt or .bin files that are actually .png files (by contents). It doesn't happen with any files that are copied into subfolders of the Desktop.
The Desktop is linked to iCloud, but always has been. I haven't changed any iCloud related settings. I have DropBox installed in a different account on the same machine, but that account in not logged in and DropBox is not running.
Can anyone explain what is going on and why it just started happening?
Here is the test script:
#!/bin/bash
do_it() {
date;
cp $1 Desktop/;
count=15;
while test $count -gt 0 && sleep 1; do
let count=count-1;
echo "$(date) $(ls Desktop/$(basename $1))";
done;
}
run() {
for n in desktop.png desktop.txt desktop.zero.bin desktop-png.bin desktop-png.txt; do
do_it Documents/$n
done;
}
run
And here is the output - notice how files that contain .png content are been moved or deleted by something but text files and binary files that don't contain PNGs are not being moved or deleted.
Thu 14 May 2020 15:09:20 AEST
Thu 14 May 2020 15:09:21 AEST Desktop/desktop.png
Thu 14 May 2020 15:09:22 AEST Desktop/desktop.png
Thu 14 May 2020 15:09:23 AEST Desktop/desktop.png
Thu 14 May 2020 15:09:24 AEST Desktop/desktop.png
Thu 14 May 2020 15:09:25 AEST Desktop/desktop.png
Thu 14 May 2020 15:09:26 AEST Desktop/desktop.png
Thu 14 May 2020 15:09:27 AEST Desktop/desktop.png
Thu 14 May 2020 15:09:28 AEST Desktop/desktop.png
ls: Desktop/desktop.png: No such file or directory
Thu 14 May 2020 15:09:29 AEST
ls: Desktop/desktop.png: No such file or directory
Thu 14 May 2020 15:09:30 AEST
ls: Desktop/desktop.png: No such file or directory
Thu 14 May 2020 15:09:31 AEST
ls: Desktop/desktop.png: No such file or directory
Thu 14 May 2020 15:09:32 AEST
ls: Desktop/desktop.png: No such file or directory
Thu 14 May 2020 15:09:33 AEST
ls: Desktop/desktop.png: No such file or directory
Thu 14 May 2020 15:09:34 AEST
ls: Desktop/desktop.png: No such file or directory
Thu 14 May 2020 15:09:36 AEST
Thu 14 May 2020 15:09:37 AEST
Thu 14 May 2020 15:09:38 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:39 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:40 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:41 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:42 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:43 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:44 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:45 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:46 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:47 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:48 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:49 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:50 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:51 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:52 AEST Desktop/desktop.txt
Thu 14 May 2020 15:09:53 AEST
Thu 14 May 2020 15:09:54 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:09:55 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:09:56 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:09:57 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:09:58 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:09:59 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:10:00 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:10:01 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:10:02 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:10:03 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:10:04 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:10:05 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:10:06 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:10:07 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:10:08 AEST Desktop/desktop.zero.bin
Thu 14 May 2020 15:10:09 AEST
Thu 14 May 2020 15:10:10 AEST Desktop/desktop-png.bin
Thu 14 May 2020 15:10:11 AEST Desktop/desktop-png.bin
Thu 14 May 2020 15:10:12 AEST Desktop/desktop-png.bin
Thu 14 May 2020 15:10:13 AEST Desktop/desktop-png.bin
Thu 14 May 2020 15:10:14 AEST Desktop/desktop-png.bin
Thu 14 May 2020 15:10:15 AEST Desktop/desktop-png.bin
Thu 14 May 2020 15:10:16 AEST Desktop/desktop-png.bin
Thu 14 May 2020 15:10:17 AEST Desktop/desktop-png.bin
ls: Desktop/desktop-png.bin: No such file or directory
Thu 14 May 2020 15:10:18 AEST
ls: Desktop/desktop-png.bin: No such file or directory
Thu 14 May 2020 15:10:20 AEST
ls: Desktop/desktop-png.bin: No such file or directory
Thu 14 May 2020 15:10:21 AEST
ls: Desktop/desktop-png.bin: No such file or directory
Thu 14 May 2020 15:10:22 AEST
ls: Desktop/desktop-png.bin: No such file or directory
Thu 14 May 2020 15:10:23 AEST
ls: Desktop/desktop-png.bin: No such file or directory
Thu 14 May 2020 15:10:24 AEST
ls: Desktop/desktop-png.bin: No such file or directory
Thu 14 May 2020 15:10:25 AEST
Thu 14 May 2020 15:10:26 AEST
Thu 14 May 2020 15:10:27 AEST Desktop/desktop-png.txt
Thu 14 May 2020 15:10:28 AEST Desktop/desktop-png.txt
Thu 14 May 2020 15:10:29 AEST Desktop/desktop-png.txt
Thu 14 May 2020 15:10:30 AEST Desktop/desktop-png.txt
Thu 14 May 2020 15:10:31 AEST Desktop/desktop-png.txt
Thu 14 May 2020 15:10:32 AEST Desktop/desktop-png.txt
Thu 14 May 2020 15:10:33 AEST Desktop/desktop-png.txt
ls: Desktop/desktop-png.txt: No such file or directory
Thu 14 May 2020 15:10:34 AEST
ls: Desktop/desktop-png.txt: No such file or directory
Thu 14 May 2020 15:10:35 AEST
ls: Desktop/desktop-png.txt: No such file or directory
Thu 14 May 2020 15:10:36 AEST
ls: Desktop/desktop-png.txt: No such file or directory
Thu 14 May 2020 15:10:37 AEST
ls: Desktop/desktop-png.txt: No such file or directory
Thu 14 May 2020 15:10:38 AEST
ls: Desktop/desktop-png.txt: No such file or directory
Thu 14 May 2020 15:10:39 AEST
ls: Desktop/desktop-png.txt: No such file or directory
Thu 14 May 2020 15:10:40 AEST
ls: Desktop/desktop-png.txt: No such file or directory
Thu 14 May 2020 15:10:41 AEST
Update: thanks to Joseph I installed this simple audit tool and discovered that it is the "bird" process renaming a file. This "bird" process is associated with iCloud and sure enough when I look into the restored files page on iCloud I can see the files that are disappearing.
So, the next question is: why iCloud doing this and how do I tell it to stop?

synchronize date in apache storm cluster

I use an apache storm topology on a cluster of 8+1 machines. The date on these machines is not the same and we may have more than 5 minutes of difference.
preprod-storm-nimbus-01:
Thu Feb 25 16:20:30 GMT 2016
preprod-storm-supervisor-01:
Thu Feb 25 16:20:32 GMT 2016
preprod-storm-supervisor-02:
Thu Feb 25 16:20:32 GMT 2016
preprod-storm-supervisor-03:
Thu Feb 25 16:14:54 UTC 2016 <<-- this machine is very late :(
preprod-storm-supervisor-04:
Thu Feb 25 16:20:31 GMT 2016
preprod-storm-supervisor-05:
Thu Feb 25 16:20:17 GMT 2016
preprod-storm-supervisor-06:
Thu Feb 25 16:20:00 GMT 2016
preprod-storm-supervisor-07:
Thu Feb 25 16:20:31 GMT 2016
preprod-storm-supervisor-08:
Thu Feb 25 16:19:55 GMT 2016
preprod-storm-supervisor-09:
Thu Feb 25 16:20:30 GMT 2016
Question:
Is the storm topology affected by this non-synchronization?
Note: I know that synchronizing is better, but the sysadmins won't do it without proving them proofs/reasons that they have to do it. Do they really have to do it, "for the topology's sake" :) ?
Thanks
It depends on the computation you are doing... It might have an effect on your result if you do time based window operations. Otherwise, it doesn't matter.
For Storm as an execution engine it has no effect at all.

Remove MongoDB from auto starting on login

I installed MongoDB through home brew on osx lion but for some reason, it keeps starting up automatically when I login.
>:mongod
Mon Aug 12 20:35:31.270 [initandlisten] MongoDB starting : pid=52473 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=Mah-iMac.local
Mon Aug 12 20:35:31.270 [initandlisten] db version v2.4.5
Mon Aug 12 20:35:31.270 [initandlisten] git version: a2ddc68ba7c9cee17bfe69ed840383ec3506602b
Mon Aug 12 20:35:31.270 [initandlisten] build info: Darwin bs-osx-106-x86-64-2.10gen.cc 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
Mon Aug 12 20:35:31.271 [initandlisten] allocator: system
Mon Aug 12 20:35:31.271 [initandlisten] options: { bind_ip: "127.0.0.1", config: "/usr/local/etc/mongod.conf", dbpath: "/usr/local/var/mongodb" }
Mon Aug 12 20:35:31.272 [initandlisten] journal dir=/usr/local/var/mongodb/journal
Mon Aug 12 20:35:31.272 [initandlisten] recover : no journal files present, no recovery needed
Mon Aug 12 20:35:31.328 [initandlisten] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 127.0.0.1:27017
Mon Aug 12 20:35:31.328 [initandlisten] ERROR: addr already in use
Mon Aug 12 20:35:31.328 [websvr] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 127.0.0.1:28017
Mon Aug 12 20:35:31.328 [initandlisten] now exiting
Mon Aug 12 20:35:31.328 dbexit: Mon Aug 12 20:35:31.328 [websvr] ERROR: addr already in use
Mon Aug 12 20:35:31.328 [initandlisten] shutdown: going to close listening sockets...
Mon Aug 12 20:35:31.328 [initandlisten] shutdown: going to flush diaglog...
Mon Aug 12 20:35:31.328 [initandlisten] shutdown: going to close sockets...
Mon Aug 12 20:35:31.328 [initandlisten] shutdown: waiting for fs preallocator...
Mon Aug 12 20:35:31.328 [initandlisten] shutdown: lock for final commit...
Mon Aug 12 20:35:31.328 [initandlisten] shutdown: final commit...
Mon Aug 12 20:35:31.335 [initandlisten] shutdown: closing all files...
Mon Aug 12 20:35:31.337 [initandlisten] closeAllFiles() finished
Mon Aug 12 20:35:31.338 [initandlisten] journalCleanup...
Mon Aug 12 20:35:31.338 [initandlisten] removeJournalFiles
Mon Aug 12 20:35:31.338 [initandlisten] shutdown: removing fs lock...
Mon Aug 12 20:35:31.338 dbexit: really exiting now
How can I remove this from starting up automatically? I don't really use mongo a lot so its kinda not needed and when I do need to use it, it's kinda annoying to get an error when I try to fire it up :/
It should be either:
launchctl unload -w ~/Library/LaunchAgents/org.mongodb.mongod.plist
or
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist

Resources