Author Topic: powershell and utc time aka greenwich london uk  (Read 28582 times)

herge

  • Member
  • ***
  • Posts: 477
Re: powershell and utc time aka greenwich london uk
« Reply #30 on: February 03, 2013, 12:24:37 AM »

 Hi DednDave:

 Yes ir did it took me a long time to find it
 I just wanted a listing of a file.
 I think they changed all the rules
 for powershell.
 They was dir /p (dos)which more or less
 paused the output.

 Regards herge
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

herge

  • Member
  • ***
  • Posts: 477
Re: powershell and utc time aka greenwich london uk
« Reply #31 on: February 03, 2013, 06:26:43 PM »
 Hi DednDave:

 
Code: [Select]

C:\Documents and Settings\User>copy c:masm32\showtim.asm | more con
Cannot access file \\.\con

C:\Documents and Settings\User>
 

 It also eats memory like a pig do not try on very large files
 you get an out of memory error i e windows.inc
 The more is not working I never had to hit space bar
 once. It stops listing when it runs out and you can
 not scroll up to start of file.
 The
Code: [Select]
  type filename.ext | more
 

 works for me.

 Regards herge

Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: powershell and utc time aka greenwich london uk
« Reply #32 on: February 03, 2013, 11:42:46 PM »
i may have the order wrong - lol
i am not as proficient with dos commands as i used to be   :P

herge

  • Member
  • ***
  • Posts: 477
Re: powershell and utc time aka greenwich london uk
« Reply #33 on: February 25, 2013, 09:43:44 PM »
 Hi DednDave:

 I final got it go and in German to with a little help
 from some assembler pals.

Code: [Select]
; 24HR.ASM 11:46 AM 6/23/2008
include \masm32\include\masm32rt.inc

.data
public dtbuf
dtbuf db 260 dup(0)
AppName db "Datum und Uhrzeit in der deutschen:", 0
crlf db 13, 10, 0
tf db "HH':'mm':'ss", 0
.code
start proc
invoke GetDateFormat, 1031, DATE_LONGDATE, 0, 0, addr dtbuf, 260
      lea   esi, offset dtbuf
      add   esi , eax  ; eax is len of format
      mov   byte ptr [ esi - 1 ] , " "
      pushad
      mov     eax,esp
      INVOKE  GetTimeFormat,LOCALE_USER_DEFAULT,TIME_FORCE24HOURFORMAT,NULL,NULL, esi,32
      add     esp,32
pop esi
invoke MessageBox, NULL, addr dtbuf, addr AppName, MB_OK
exit
      ret
start endp
    end start


 It has not got pass 12 am yet so I am not
 100% sure it works yet. But is compiled great.
 It does work in the afternoon.
 Used Google translate to germanize the title
 hope it's clean.
« Last Edit: March 02, 2013, 08:26:16 AM by herge »
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

herge

  • Member
  • ***
  • Posts: 477
Re: powershell and utc time aka greenwich london uk
« Reply #34 on: March 04, 2013, 12:45:08 AM »

 Hi Rubber Duck Fans:

 By popular demand well just me.
 Warning this program uses a kludge i e we cheat.
 We get UTC time aka GMT or London England time.
 Then we add one to hour to get GMT + 1.
 I do not recommend running this program @ 23:00 or 11 PM CET i e German Time.
Code: [Select]
; 24HR.ASM 11:46 AM 6/23/2008
include \masm32\include\masm32rt.inc

.data
stm    SYSTEMTIME<>
public dtbuf
dtbuf db 260 dup(0)

AppName db "Datum und Uhrzeit in der deutschen:", 0
crlf db 13, 10, 0
tf db "HH':'mm':'ss", 0
.code
start proc
      mov   esi, offset stm
      invoke GetSystemTime, esi; Get UTC
      mov   ax, stm.wHour
      inc   ax; GET UTC +1 i e CET
      mov   stm.wHour, ax 
invoke GetDateFormat, 1031, DATE_LONGDATE, addr stm, 0, addr dtbuf, 260
      lea   esi, offset dtbuf
      add   esi , eax  ; eax is len of format
      mov   byte ptr [ esi - 1 ] , " "
      pushad
      mov     eax,esp
      INVOKE  GetTimeFormat,1031,TIME_FORCE24HOURFORMAT,addr stm,NULL, esi,32
      add     esp,32
pop esi
invoke MessageBox, NULL, addr dtbuf, addr AppName, MB_OK
exit
      ret
start endp
    end start

 We have now got GMT + 1 which is CET i e time in Berlin, Germany,

Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: powershell and utc time aka greenwich london uk
« Reply #35 on: March 04, 2013, 02:50:19 AM »
Code: [Select]
      mov   ax, stm.wHour
      inc   ax; GET UTC +1 i e CET
      cmp   ax, 24
      jb    @F

      sub   ax, 24

@@:   mov   stm.wHour, ax 

or

Code: [Select]
      mov   ax, stm.wHour
      sub   ax, 23; GET UTC +1 i e CET
      jae   @F

      add   ax, 24

@@:   mov   stm.wHour, ax 

herge

  • Member
  • ***
  • Posts: 477
Re: powershell and utc time aka greenwich london uk
« Reply #36 on: March 04, 2013, 02:59:58 AM »

 Hi DednDav:

 I am sure sure there is an easier way.
 But for now it goes.

 Thanks for the ideas.
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: powershell and utc time aka greenwich london uk
« Reply #37 on: March 04, 2013, 03:28:53 AM »
of course - you could use the right Locale Identifier   :biggrin:

herge

  • Member
  • ***
  • Posts: 477
Re: powershell and utc time aka greenwich london uk
« Reply #38 on: March 04, 2013, 03:34:08 AM »

 Hi DednDave:

 Tossed first example in qeditor.
 Compiled and tosed it to WinDbg.

 Herge Says All Right!
 Thanks DednDave.
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: powershell and utc time aka greenwich london uk
« Reply #39 on: March 04, 2013, 03:38:02 AM »
the second one is a little better, i think   :t
should be 2 bytes shorter

herge

  • Member
  • ***
  • Posts: 477
Re: powershell and utc time aka greenwich london uk
« Reply #40 on: March 04, 2013, 03:42:25 AM »
 Hi DednDave:

 The LCID for germany is 1031 decimal that's why
 we get nice German names.

 A site to look up your LCID @ MicroSoft.

 
Code: [Select]
http://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).aspx

 Regards herge
« Last Edit: March 04, 2013, 07:26:39 PM by herge »
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

herge

  • Member
  • ***
  • Posts: 477
Re: powershell and utc time aka greenwich london uk
« Reply #41 on: March 04, 2013, 09:27:58 PM »
 Hi Rubber Duck & UTC & GMT & Zulu Fans:

 We got all that. To check your computer date and time the
 folks in Ottawa, Ontario, CANADA have a site @ NRC.
 I will let people @NRC explain NRC.


 http://time5.nrc.ca/JavaClock/timeDisplayWE.shtml


 For America try NIST.

http://nist.time.gov/

 Pick Your Time Zone and Go.
« Last Edit: March 10, 2013, 06:20:00 PM by herge »
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: powershell and utc time aka greenwich london uk
« Reply #42 on: March 05, 2013, 01:07:17 AM »
i used to visit CHU at 7.335 mHz (they broadcast on a couple other frequencies, as well)
a few years ago, they expanded the international broadcast band in ITU regions 1 and 3
CHU experienced some interference, so they moved to 7.85 mHz or something like that

here in the US, we have WWV (and WWVL, WWVB)
they broadcast at several frequencies, most notably 2.5, 5, 10, 15, 20 mHz
WWVL is at 20 kHz and WWVB is at 60 kHz

you can see what CHU sounds like, here...
http://en.wikipedia.org/wiki/CHU_%28radio_station%29#Time_signal_format

herge

  • Member
  • ***
  • Posts: 477
Re: powershell and utc time aka greenwich london uk
« Reply #43 on: March 05, 2013, 05:56:51 PM »

 Hi DednDave:

 We are going to the dogs.
 Breaker one nine oh the good
 old CB radios before portable telephones.
 There use to be size of a lunch box. Now
 about the size of a pack of fags(smokes, cigarettes).
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: powershell and utc time aka greenwich london uk
« Reply #44 on: March 05, 2013, 06:12:26 PM »
heathkit used to make one we called the "lunchbox"   :P
they made them for 3 different ham bands and one for cb, too
back then, probably the cheapest way to get on the air