Page 1 sur 1

Problème avec la fonction CDat

MessagePublié: 10 Fév 2011 à 11:15
par gouff
Bonjour,

Connaissez vous un moyen de récupérer le formatage des dates sur un serveur Chinois et US.

Sur agent que j'ai développé, je récupère une date passée en string(url)
et je la convertie avec la fonction lotuscript CDat.

Or en fonction du serveur où il est exécuté, le formatage retourné n'est pas du tout le même : je dois donc prévoir ces cas de figure dans mon code.

Merci d'avance pour vos réponses.
Damien

MessagePublié: 10 Fév 2011 à 12:58
par Michael DELIQUE
salut

reagrde si cette fonction ne t'aiderais pas un peu

Code : Tout sélectionner
Public Function DateSystemFormat() As String
   
   REM renvois le format de la date
   
   Dim international As NotesInternational
   Dim Separator As String
   
   On Error Goto ErreurHandle
   
   DateSystemFormat = ""
   If Session Is Nothing Then
      Set Session = New NotesSession
   End If
   
   Set international = Session.International
   Separator = international.DateSep
   
   If international.IsDateDMY Then
      DateSystemFormat  = "DD"+Separator+"MM"+Separator+"YYYY"
   Elseif international.IsDateMDY Then
      DateSystemFormat  = "MM"+Separator+"DD"+Separator+"YYYY"
   Elseif international.IsDateYMD Then
      DateSystemFormat  = "YYYY"+Separator+"MM"+Separator+"DD"
   Else
      Error 9999,"Error Format date !"
      Exit Function
   End If   
   
   Set international = Nothing   
   
   Exit Function
ErreurHandle:
   Msgbox "("+Structure_Log+" : "+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
   DateSystemFormat = ""
   Exit Function
End Function

MessagePublié: 10 Fév 2011 à 13:08
par gouff
Super-Michael a encore frappé!
Je teste ça, merci beaucoup...