Author Topic: What's up Time Format  (Read 5299 times)

herge

  • Member
  • ***
  • Posts: 477
What's up Time Format
« on: January 30, 2013, 06:54:28 AM »

 Hi Everbody:

Code: [Select]
; REM SHOWTIM.ASM Tuesday, January 25, 2011 8:22 AM
; Author: Herge
; Location: Waterloo, Ontario, CANADA
.586
.model flat, stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
.data
stm  SYSTEMTIME<>
dateformat  db " dddd, MMMM, dd, yyyy", 0
timeformat  db "hh':'mm':'ss tt",0 ; Here
date_buf db 260 dup (0)
        db 2 dup (0)
.code

start   proc    near
      invoke   GetLocalTime, addr stm; put Values in stm
      invoke   GetDateFormat, 0, 0, \
               0, ADDR dateformat, ADDR date_buf, 260
; Print Date
invFor:
invoke GetDateFormat, 0, 0, \
            ADDR stm, ADDR dateformat, ADDR date_buf, 260
mov ecx, offset date_buf
mov byte ptr [ eax + ecx - 1 ], ' ';replace null with space
      add   ecx, eax 
; Print Time!
invPrt:
invoke GetTimeFormat, 0, 0, \
                  ADDR stm, ADDR timeformat, ecx, 20
invMess:
invoke MessageBox, 0, addr date_buf, addr date_buf, MB_OK
invX:
      invoke      ExitProcess, 0
start   endp     
        end start


 I have two computers with masm32 on them.
 One does Not show the AM/PM in the message box even thou date_buf has
 the correct bytes. I compiled on both computers and took code back and forth.
 windbg says all is cool but still shows the wrong output. I get 3 dots in Title Bar.
 This computer is having problems with search.


 Any Ideas ?
 or suggestions.

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

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1209
Re: What's up Time Format
« Reply #1 on: January 30, 2013, 07:31:15 AM »
The code works fine on my Windows 2000 system. I tried changing the time format in Control Panel/Regional Options to eliminate the AM/PM field, and even after a reboot the code still displayed the field. You could try experimenting with the Locale and dwFlags parameters.
Well Microsoft, here’s another nice mess you’ve gotten us into.

herge

  • Member
  • ***
  • Posts: 477
Re: What's up Time Format
« Reply #2 on: January 30, 2013, 08:35:32 AM »

 Hi MichaelW:

 I think it's this computer I am having DEP errors and Search is not finding anything,
 ie dir > temp.txt qeditor temp.txt and copy a filename to search and nothing happens.
 I have a powershell installed and the ISE does not behave the same as Powershell.
 Also I found out you have .\filename or it will grab the same Filename which is before
 you on the Path. It took me a while to figure out. The examples for Powershell are
 at the usually low standards we have to accept. They think the command prompt
 will execute i e c:\masm32\bin>
 # is a REM marker
 The certificate Storage X.509 is not very well set up
 and have not got it sorted yet old Dos batch commands in Powershell don't do
 anything.
 Each error produces at least 4 red lines of absolute drivel he/she must have
 been a former tech writer,
 You also have to watch your Dots and Commas. especially in a popup box!
 Having a bad time with some sort of RunDLL32.exe virius on other machine.

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

Magnum

  • Member
  • *****
  • Posts: 2354
Re: What's up Time Format
« Reply #3 on: January 30, 2013, 09:51:10 AM »

 Hi MichaelW:

 I think it's this computer I am having DEP errors and Search is not finding anything,
 ie dir > temp.txt qeditor temp.txt and copy a filename to search and nothing happens.
 I have a powershell installed and the ISE does not behave the same as Powershell.
 Also I found out you have .\filename or it will grab the same Filename which is before
 you on the Path. It took me a while to figure out. The examples for Powershell are
 at the usually low standards we have to accept. They think the command prompt
 will execute i e c:\masm32\bin>
 # is a REM marker
 The certificate Storage X.509 is not very well set up
 and have not got it sorted yet old Dos batch commands in Powershell don't do
 anything.
 Each error produces at least 4 red lines of absolute drivel he/she must have
 been a former tech writer,
 You also have to watch your Dots and Commas. especially in a popup box!
 Having a bad time with some sort of RunDLL32.exe virius on other machine.

 Regards herge

Thanks.

Your time program worked fine on WinXP Pro.

Kaspersky makes a good rescue disk that you  put on a CD.

Besides scanning, it also lets you makes reg changes, and download updates.

Andy

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

Adamanteus

  • Member
  • **
  • Posts: 234
    • LLC "AMS"
Re: What's up Time Format
« Reply #4 on: January 30, 2013, 10:51:01 AM »
I also agree that problem with change locale exists - so, except SetLocaleInfo no documented way to do it. And I don't know GetDateFormat is based on GetLocaleInfo output or not, but maybe need to begin search somewhere there.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: What's up Time Format
« Reply #5 on: January 30, 2013, 11:07:45 AM »
i think i found the problem

; Location: Waterloo, Ontario, CANADA

isn't it always PM up there ?   ;)

Magnum

  • Member
  • *****
  • Posts: 2354
Re: What's up Time Format
« Reply #6 on: January 30, 2013, 11:29:28 AM »
Pritty lame.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

frktons

  • Member
  • ***
  • Posts: 491
Re: What's up Time Format
« Reply #7 on: January 30, 2013, 12:20:42 PM »
On my pc win7/64 it works fine.

herge

  • Member
  • ***
  • Posts: 477
Re: What's up Time Format
« Reply #8 on: January 30, 2013, 03:32:53 PM »

 Hi dedndave :

 True, but the other half of the night is AM.

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