

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
5 messages in org.openoffice.fr.progRe: [prog] Dates boite de dialogue et...| From | Sent On | Attachments |
|---|---|---|
| nicolas | Aug 29, 2006 9:05 am | |
| Marceau GUIHARD | Aug 29, 2006 10:51 am | |
| Serge LE LOUARNE | Aug 29, 2006 12:49 pm | |
| Marceau GUIHARD | Aug 29, 2006 1:49 pm | |
| Serge LE LOUARNE | Aug 30, 2006 4:18 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [prog] Dates boite de dialogue et API | Actions... |
|---|---|---|
| From: | Marceau GUIHARD (marc...@wanadoo.fr) | |
| Date: | Aug 29, 2006 1:49:38 pm | |
| List: | org.openoffice.fr.prog | |
Désolé, j'ai cherché dans l'API un service "com.sun.star.util.date", je n'ai pas trouvé, par contre, il existe une structure "com.sun.star.util.Date" qui répond à la question et je l'ai testée, ça marche très bien.
Sub Main() Dim DateOOo As New com.sun.star.util.Date Dim DateISO As String DateIso ="20060829" DateOOo.year=Left(DateISO,4) DateOOo.Month=Mid(DateISO,5,2) DateOOo.Day=Right(DateISO,2) print DateOOo.Day & "/" & DateOOo.Month & "/" & DateOOo.year End Sub
Cordialement
Marceau
Serge LE LOUARNE a écrit :
nicolas a écrit :
Je cherche à enregistrer des données dates dans ma base de donnée dbase, cela depuis une boite de dialogue, et en passant par un rowset. Donc d'apres ce que j'ai compris du Livre, les boites de dialogue renvoient une date format ISO, et l'api a besoin d'objets de date spécifique. Donc j'ai écrit le petit programme suivant pour faire la conversion: Function ConvDate(DateISO as long) dim convdateISO as new com.sun.star.util.date convdateISO.year=Left(DateISO,4) convdateISO.Month=Mid(DateISO,4,2) convdateISO.Day=Right(DateISO,2) Convdate=convdateISO end function ALors apparemment basic ne connait pas d'objet du type com.sun.star.util.date, j'ai pourtant recopier la def de la page 588 .Je navigue a vu avec l'API, qu'est ce qui ne va pas? quelqu'un aurait il une réponse ... ou une petite fonction déja écrite qui tournerait.??.. Nico
Hello,
Il faut d'abord définir le service avant de l'utiliser.
dim convdateISO as object ConvDate = createUnoService("new com.sun.star.util.date")
Puis utiliser : ===================================== sub main
ConvDate(20060829)
end sub
sub ConvDate(DateISO as string)
dim convdate as object dim convdateYear as string dim convdateMonth as string dim convdateDay as string dim dateFin as string
ConvDate = createUnoService("new com.sun.star.util.date") convdateYear=Left(DateISO,4) convdateMonth=Mid(DateISO,5,2) convdateDay=Right(DateISO,2) dateFin = convdateDay & "-" & convdateMonth & "-" &convdateYear print dateFin
end sub ======================================
A+ Serge
--------------------------------------------------------------------- To unsubscribe, e-mail: prog...@fr.openoffice.org For additional commands, e-mail: prog...@fr.openoffice.org
---------------------------------------------------------------------------------------
Orange vous informe que cet e-mail a ete controle par l'anti-virus mail. Aucun virus connu a ce jour par nos services n'a ete detecte.







