Friday, December 10, 2010

Set Local Computer Time with Powerbuilder

With External Function feature, we can set the Local Computer's time with Powerbuilder.

First, we need to declare the external function, called SetLocalTime from kernel32.dll

1:  FUNCTION long SetLocalTime(ref str_SYSTEMTIME lpSystemTime ) LIBRARY "kernel32.dll" alias for "SetLocalTimeA"  

To use the function, just pass a datetime variable when you call the function.

Example:
1:  DataTime dtToday  
2:    
3:  dtToday = DateTime(Today(),Now())  
4:  SetLocalTime(dtToday)  

1 comment :

  1. Great post which explains us how we can go for powerbuilding applications

    ReplyDelete