How can i deactivate the time based workflow action through code. If a time-based WF action is already schedule to send a mail on a date in near future. Can I change the date or deactivate the action through code.
The only way to "kill" a pending transaction for now is to modify the record so it doesn't meet the criteria any longer. You can't modify the date/time it will go off, unless that date/time is driven by a field on the record, in which case updating the record will change the firing time. For example, if the date field called "Due Date" triggers a workflow rule on the record that will send a notification on the due date, then changing that field will change the date the notification will be sent.
The data for queued actions is stored in a WorkflowTimeQueue record, which isn't accessible by the API. We can view these pending actions in the Time-Based Workflow queue, but we only have the option to delete, not modify, and we may only do so manually.